0👍
If you already know how to use Vuex to store data in a todo app, there is nothing different about storing user data. Vuex just works with data, period. So you can either commit a mutation or dispatch an action and pass along your data.
- [Vuejs]-How to properly build a Vue component library using Vuetify
- [Vuejs]-Vue v-on:click change it to load or mouse over event
0👍
Actually you must store user data into the store, and also store data into browser’s localStorage
to persist user data on refresh. Big frameworks like NuxtJs
are working this way.
.then(() => {
console.log('user auth = ' + this.user.uid)
this.$store.dispatch('storeJustLoggedInUser', this.user.uid);
})
In your vuex store:
actions: {
storeJustLoggedInUser({commit, state}, uid){
commit('STORE_USER_UID', uid)
}
}
This is just a pseudo code, hopefully you get the idea!
- [Vuejs]-Export default async function haven't execute the whole function during import in another js
Source:stackexchange.com