00
This commit is contained in:
24
src/main.js
24
src/main.js
@@ -1,4 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import i18n from './i18n/i18n'
|
||||
@@ -9,8 +10,31 @@ import 'element-ui/lib/theme-chalk/display.css';
|
||||
|
||||
Vue.config.productionTip = false
|
||||
Vue.use(ElementUI)
|
||||
Vue.use(Vuex)
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
isEnglish: false,
|
||||
menuList :{},
|
||||
},
|
||||
mutations: {
|
||||
increment (state) {
|
||||
state.count++
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
setEnglish(isEnglish){
|
||||
this.store.isEnglish = isEnglish
|
||||
},
|
||||
},
|
||||
getters:{
|
||||
getEnglish(){
|
||||
return this.store.isEnglish
|
||||
}
|
||||
}
|
||||
})
|
||||
new Vue({
|
||||
i18n,
|
||||
router,
|
||||
store: store,
|
||||
render: h => h(App)
|
||||
}).$mount('#app')
|
||||
|
||||
Reference in New Issue
Block a user