Remember some of the problems encountered when using mpvue

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.jsIntroducing store, and bind to the prototype Vue constructor, so that all components of each vue can this.$storeaccess the object store
 
Two, Flyio

Guess you like

Origin www.cnblogs.com/huangfeihong/p/11267437.html