First, the use of vuex in mpvue
1, vue used vuex, in the main.js:
import store from './store'
new view ({
store
})
2, mpvue use vuex, in the main.js:
import store from './store'
Vue.prototype.$store=store;//添加即可
补充:main.js
Introducing store, and bind to the prototype Vue constructor, so that all components of each vue can this.$store
access the object store
Two, Flyio