Answer the question
In order to leave comments, you need to log in
How to properly get and display data from the server in vue/vuex?
I have a user in state which is null by default
state: {
user: null
}
created() {
this.$store.dispatch('loadUser')
},
computed: {
username() {
return this.$store.getters.username
}
}
Answer the question
In order to leave comments, you need to log in
and if I do a v-if check, then nothing will be displayed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question