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?
欧阳克2017-07-05 11:10:19
const a = new Vuex.Store({})
Object.defineProperty(Vue.prototype, '$a', {value: this.$store})
But this is superfluous
PHP中文网2017-07-05 11:10:19
Refer to this official example:
https://jsfiddle.net/n9jmu5v7...
In fact, if you change store
to another name, it will have no effect.