Answer the question
In order to leave comments, you need to log in
Why is the method from mapActions is undefined?
In the component I have the following:
import { mapActions, mapGetters } from 'vuex';
...
methods: {
...mapActions('modulename', [
'createTopic',
]),
submitForm() {
this.createTopic({
name: this.createName,
url: this.url,
description: this.createDescription,
parentId: event.id,
})
}
import actions from './actions.js';
export default {
namespaced: true,
actions
}
import modulename from './module/';
export default {
modules: {
...
modulename,
...
}
}
Error in v-on handler: "TypeError: this.createTopic(...) is undefined"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question