I have just developed a new component in VueJS and defined two methods. One method is an action (vuex) and the other one is a regular method.
actionTypes.js
const TOGGLE_PREVIEW = 'togglePreview';
component
method: {
...mapActions([actionTypes.TOGGLE_PREVIEW]),
onClickPreview: () => {
this.togglePreview();
}
An issue has occurred, displaying
Uncaught TypeError: Cannot read property 'togglePreview' of undefined
.