3👍
Nuxt automatically transforms store/**/*.js
files into Vuex modules, so you don’t need to setup your own store in store/index.js
, and it should be removed.
Also, your actions
, mutations
, and getters
currently return a function that returns an object, but that should only be done for state
. Instead, they should be objects:
// store/liveEvents/index.js
export const state = () => ({
eventsList: []
});
export const actions = {
async eventsList({ commit }) {
// the actions ...
},
}
export const mutations = {
SET_EVENTLIST(state, events) {
state.eventsList = events;
},
}
export const getters = {
}
- [Vuejs]-Vue 3 Element-Plus table could not show axios result when I use script set up
- [Vuejs]-How to convert Vue 2 web site to PWA wab app?
Source:stackexchange.com