添加 Vuex
This commit is contained in:
@@ -2,6 +2,7 @@ import Vue from 'vue';
|
||||
import ElementUI from 'element-ui';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import store from './store';
|
||||
|
||||
import config from './assets/js/config';
|
||||
import navLinks from './assets/js/navLinks';
|
||||
@@ -18,6 +19,7 @@ Vue.config.productionTip = false;
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
data: function () {
|
||||
return {
|
||||
config,
|
||||
|
12
src/store/index.js
Normal file
12
src/store/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
export default new Vuex.Store({
|
||||
state: {},
|
||||
getters: {},
|
||||
mutations: {},
|
||||
actions: {},
|
||||
modules: {},
|
||||
});
|
Reference in New Issue
Block a user