add vuex store to vue app
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
"loopback-component-explorer": "^4.0.0",
|
||||
"strong-error-handler": "^1.0.1",
|
||||
"vue": "^2.1.10",
|
||||
"vue-router": "^2.2.0"
|
||||
"vue-router": "^2.2.0",
|
||||
"vuex": "^2.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.22.1",
|
||||
|
||||
@@ -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;
|
||||
@@ -5984,6 +5984,10 @@ vue@^2.1.10:
|
||||
version "2.1.10"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-2.1.10.tgz#c9235ca48c7925137be5807832ac4e3ac180427b"
|
||||
|
||||
vuex@^2.1.2:
|
||||
version "2.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vuex/-/vuex-2.1.2.tgz#15d2da62dd6ff59c071f0a91cd4f434eacf6ca6c"
|
||||
|
||||
watchpack@^0.2.1:
|
||||
version "0.2.9"
|
||||
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-0.2.9.tgz#62eaa4ab5e5ba35fdfc018275626e3c0f5e3fb0b"
|
||||
|
||||
Reference in New Issue
Block a user