代码
import Vue from 'vue'
import App from './App'
import router from './router'
import common from './assets/js/common'
import Vuex from 'vuex'
import ElementUi from 'element-ui'
import 'element-ui/lib/theme-default/index.css'
import MintUi from 'mint-ui'
import 'mint-ui/lib/style.css'
Vue.config.productionTip = false
Vue.use(common)
Vue.use(ElementUi)
Vue.use(MintUi)
Vue.use(Vuex)
const vuex_store = new Vuex.store({
state:{ msg:""}, mutations:{ showUserName(state){ alert(state.msg); } }
})
new Vue({
el: '#app',
store:vuex_store,
router,
template: '<App/>',
components: { App }
})
报错如下
Uncaught TypeError: __WEBPACK_IMPORTED_MODULE_4_vuex__.a.store is not a function
慕婉清6462132
冉冉说