When attempting to access my namespaced store in Vue, I encountered an issue:
methods: {
...mapActions('Modal', [
'toggleActive',
]),
close: () => {
this.toggleActive();
}
This resulted in the following error message:
Uncaught TypeError: Cannot read property 'toggleActive' of undefined
However, when I made a slight adjustment like so:
close: function() {
this.toggleActive();
}
I was able to resolve the issue. How can I effectively implement ES6 function syntax with vue/vuex?