在微信小程序上使用该垫片。报出“ uni is not defined ”的错误。
应用了MpVue。我的配置是这样的:
`
import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment: state => {
const obj = state
obj.count += 1
},
decrement: state => {
const obj = state
obj.count -= 1
}
},
plugins: [
createPersistedState({
storage: this.$localStorage
})
]
})
在微信小程序上使用该垫片。报出“ uni is not defined ”的错误。 应用了MpVue。我的配置是这样的: ` import Vue from 'vue' import Vuex from 'vuex' import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex)
const store = new Vuex.Store({ state: { count: 0 }, mutations: { increment: state => { const obj = state obj.count += 1 }, decrement: state => { const obj = state obj.count -= 1 } }, plugins: [ createPersistedState({ storage: this.$localStorage }) ] })
export default store `