Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

251
Visualizações
unable to access vuex store property in safari. code is working fine in Chrome

I am desperately needing some help with vuejs vuex store. it is working absolutely fine in chrome but in safari store property is not being picked up. basically I have stored a user object in Vuex store as follows: - here is the image of my code

here is the image of within component where I am trying to access the property from store

here is the image of when axios call is made and within response I am triggering the mutation

state:{
    user:{},
    student:{}
    },
    
mutations:{
    setUser(state,payload) {
        state.user = payload;
        },
        
    setLoggedIn (state,payload) {
        state.isLoggedIn = payload;
        },
    
    setStudent(state,payload){
        state.student = payload;        
        }
        
        },

 getters:{
 
    isStudent: state => {
 
    if(state.user.user_type === 'student') {
     return true;
   }
   }
 
 }

I am calling the mutation from inside the login component whilst executing axios call request and setting the user and student through appropriate commit from the component. However, when I am trying to access the user property inside the component, it works fine for Chrome but it is not working for Safari. Here is how I am calling for state user property inside the component: -

computed:{
       
     computedStatus(){

                return this.$store.state.isLoggedIn;

            },
        computedUserType(){
                return this.$store.state.user.user_type;
        },
        isUserStudent(){
            return this.$store.getters.isStudent;
        }

    }

The property isUserStudent is used inside the component and is a dependency to further functionalities. This property is assessed correctly and as expected inside Chrome/Firefox, but in safari it is not being assessed. I am really puzzled what's going on here and hope that someone can support please

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda