为什么const 变量名 = new Vuex.Store({});用 this.$变量名 就不能拿到定义的数据,但是如果变量名是store就可以呢?
1 回答

慕码人2483693
TA贡献1860条经验 获得超9个赞
const a = new Vuex.Store({})
Object.defineProperty(Vue.prototype, '$a', {value: this.$store})
不过这样就多此一举了
添加回答
举报
0/150
提交
取消