I want to set Vuex mutations as follows:
export default {
props: {
store: String
},
methods: {
...mapMutations({
changeModel: `${this.store}/changeModel`
})
}
}
But I catch the error:
Uncaught TypeError: Cannot read property 'store' of undefined
How do I correctly use props inside the module mutation name?
I want to map this.$store.commit('form1/changeModel')
, where form1
is set from props.