0๐
โ
If you check the documentation for vuex 4.0 you can see that you are using createStore
incorrectly (assuming that you are using ES2015 syntax). state
should be a function returning your initial store state. Furthermore your syntax for the object properties is wrong. You need to use :
instead of =
.
So your code should be:
export default createStore({
state () {
return {
isLoading: false,
isAuthenticated: false,
token: ''
}
}
})
Source: https://next.vuex.vuejs.org/guide/#the-simplest-store
Source:stackexchange.com