0👍
I think getter allUsers
has no difference with state.users
, you could set its default value to []
.
const selectedUser = this.$store.getters["user/allUsers"].find(
(user) => {
return user.username === this.currentUsername;
}); // here this.currentUsername is undefined in vuex? so
// Uncaught (in promise) TypeError: Cannot read property 'roles' of undefined
you can use vue devtools to inspect its data flow to check the issue
- [Vuejs]-Vue :page don't display after add router-link
- [Vuejs]-How can I integrate a static landing page in a VueJS app?
Source:stackexchange.com