0👍
At store.js
you are initializing storeInfo
as null
.
push
is a method that works only for arrays, so it won’t work on a null
variable.
Try to set storeInfo
as an empty array instead:
export const store = new Vuex.Store({
state: {
storyInfo: []
},
...
0👍
Posting my own solution. In Store, replace ‘addInfoToStory’ mutation with the story path of what needs to change:
addInfoToStory (state, payload) {
state.storyInfo.episodes = payload
}
this will modify only that property in state.
Source:stackexchange.com