cuando cambio de pagina quedan los errores del formulario, me gustaria que desaparecieran una vez que cambio de pagina, en cambio cuando vuelvo a la pagina siempre los visualizo. ¿Como lo puedo hacer?
estos son mis errores
<template> <b-form @submit="onSubmit"> <div v-if="getError"> <div v-for="(_errors, key) in getError"> <b-alert v-for="error in _errors" show variant="danger"> <h2>{{ formatKey(key) }} :</h2> <li>{{ error }}</li> </b-alert> </div> </div>este es mi js
computed: { ...mapGetters([ 'getError' ]), methods : { starDate() { return Date.now() }, highlightFrom (elem) { this.validate_start = true this.disabledDates.to = elem }, validate (elem){ return elem !== null && elem !== '' }, setSelected(value) { this.hiring_contract_category = value; this.contract = value === 'contract'; }, async onSubmit(event) { this.errors = false; this.$store.commit('commit_contractable_id', this.id) await this.$store.dispatch('create_contract', this.form) }, formatKey (key) { return this.$t('vue.' + key.replace('contract_data.', '')) }Intente borrar cuando su componente esté montado.
mounted() { // commit to store using mutation (you will need to update your store with method... this.$store.commit('clear_errors') }