Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
Hidden errors when i type back with vuejs

when I change the page the errors of the form remain, I would like them to disappear once I change the page, instead when I return to the page I always view them. How can i do?

these are my errors

<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>

this is my 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.', ''))
    }
about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Try to clear when your component is mounted.

mounted() {
  // commit to store using mutation (you will need to update your store with method...
  this.$store.commit('clear_errors')
}
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda