0👍
The problem is in your store.js file. You are setting the default state for currentStory to Number. Setting it to an actual number instead should solve your problem:
export const store = new Vuex.Store({
state: {
currentStory: 0
},
mutations: {
setCurrentStory(state, ID) {
state.currentStory = ID
}
},
getters: {
currentStory: state => state.currentStory
}
})
Additionally, in story.vue, it is unnecessary to specify storyID in the data as you already have it as a computed property (there might be an error thrown for duplicate keys)
- [Vuejs]-How to embed an element-ui component into a vuetify component?
- [Vuejs]-In vue,how to pass values to children component when using component tag for dynamic switching component
Source:stackexchange.com