Answer the question
In order to leave comments, you need to log in
Dynamic access in ...mapAction and ...mapGetter?
import { mapActions, mapGetters } from 'vuex';
export default {
name: 'posts_list',
props: {
type: {
type: String,
required: false,
default: 'posts',
},
},
computed: {
...mapGetters({
list: `list/${this.type}`, // error, this = undefined
сannot read property 'type' of 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