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

250
Vistas
How do I stay on the second form when the page is reloaded? Vue.js

I need to create an web-app that has only 2 pages. There are two stages of filling out forms on the first page. I can't create two separate pages. Two forms on one page. So how do I stay on the second form when the page is reloaded?

Here is me component Register.vue:

    <form v-if="step === 1">
       <!-- some input fields about new user -->
    </form>
    <form v-if="step === 1">
       <!-- some input fields about additional info about new user -->
    </form>

What I tried:

data() {
  return {
     step: 1
  }
},
mounted() {
  if (performance.navigation.type == 1) {
     if (this.step === 1) {
        this.step = 1;
     }
     if (this.step === 2) {
       this.step = 2;
     }
  }

},

Also tried to do the same in the created hook.

Any help would be much appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can keep step inside the session storage so that the value will not be lost while reloading.

To set the value:

sessionStorage.setItem("step", step)

To retrieve the value:

sessionStorage.getItem("step")
about 4 years ago · Juan Pablo Isaza 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