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

235
Vistas
Vue - Is it fine to store a value in session storage rigth from the main.js file?

So I have a session storage value set to false that I need to keep track of for the user session that is managed by Vuex. I set up the value right from the main.js file as such:

import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import axios from 'axios';
import store from './store'

createApp(App).use(store).use(router).mount('#app')
sessionStorage.setItem('session', false);

App.prototype.$http = axios

And I was wondering whether it was ok to do it as such right from main.js file or if vuzI should do it elsewhere, such as in App.vue.

Thanks in advance

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

0

that's ok,the code runs well, you can use sessionStorage.setItem anywhere,because this is a synchronous method. if it goes badly, there must be something wrong with the logic of the code, i need more clues.

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