Vuex supports expanding specific functions and declaring properties for components via strings or object literals. However, it is possible for these properties to duplicate object properties at the expanded location, or to duplicate each other. This usually produces unintended results.
export default {
computed: {
...mapState(['foo']),
foo() {
return this.bar
},
},
}
export default {
computed: {
...mapState(['foo']),
...mapState('bar', ['foo', 'baz']),
},
}
export default {
computed: {
...mapState(['foo']),
bar() {
return this.baz
},
},
}