【发布时间】:2021-09-06 14:50:40
【问题描述】:
在我的nuxt 项目中,我尝试使用mapGetters 和docs 中描述的重命名对象语法。 Getter 在名为 currentTournament 的模块中命名。
这是 mixin 中的计算属性:
computed: {
...mapGetters('currentTournament', [{ tAllowedBaskets: 'allowedBaskets' }]),
}
如果我记录组件的this,而不是tAllowedBaskets 属性,则会出现一个新属性[object Object]: undefined。但是,如果我使用“简单”字符串语法:
...mapGetters('currentTournament', ['allowedBaskets'])
allowedBaskets 属性正确显示。
为什么对象语法不起作用?
【问题讨论】:
标签: vue.js vuejs2 nuxt.js vuex