add vuex store to vue app
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import Vue from 'vue';
|
||||
import router from './router';
|
||||
import store from './store';
|
||||
|
||||
new Vue({
|
||||
const app = new Vue({
|
||||
router,
|
||||
store,
|
||||
render: h => h('router-view'),
|
||||
}).$mount('#app');
|
||||
});
|
||||
|
||||
app.$mount('#app');
|
||||
|
||||
11
src/store.js
Normal file
11
src/store.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import Vue from 'vue';
|
||||
import Vuex from 'vuex';
|
||||
|
||||
Vue.use(Vuex);
|
||||
|
||||
const store = new Vuex.Store({
|
||||
state: {
|
||||
},
|
||||
});
|
||||
|
||||
export default store;
|
||||
Reference in New Issue
Block a user