Why const variable name = new Vuex.Store({});You cannot get the defined data by using this.$ variable name, but what if the variable name is store?
业精于勤,荒于嬉;行成于思,毁于随。
const a = new Vuex.Store({}) Object.defineProperty(Vue.prototype, '$a', {value: this.$store})
But this is superfluous
Refer to this official example:
https://jsfiddle.net/n9jmu5v7...
In fact, if you change store to another name, it will have no effect.
store
But this is superfluous
Refer to this official example:
https://jsfiddle.net/n9jmu5v7...
In fact, if you change
store
to another name, it will have no effect.