Selaa lähdekoodia

Adding Vuex

In future it will be used to cache data from the server.
For now the user login object will be added.
Ecconia 7 vuotta sitten
vanhempi
commit
d7b00729bf
3 muutettua tiedostoa jossa 20 lisäystä ja 1 poistoa
  1. 2 1
      package.json
  2. 2 0
      src/main.js
  3. 16 0
      src/store.js

+ 2 - 1
package.json

@@ -9,7 +9,8 @@
   },
   "dependencies": {
     "vue": "^2.5.17",
-    "vue-router": "^3.0.1"
+    "vue-router": "^3.0.1",
+    "vuex": "^3.0.1"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "^3.0.4",

+ 2 - 0
src/main.js

@@ -1,10 +1,12 @@
 import Vue from 'vue'
 import App from './App.vue'
 import router from './router'
+import store from './store'
 
 Vue.config.productionTip = true
 
 new Vue({
   router,
+  store,
   render: h => h(App)
 }).$mount('#app')

+ 16 - 0
src/store.js

@@ -0,0 +1,16 @@
+import Vue from 'vue'
+import Vuex from 'vuex'
+
+Vue.use(Vuex)
+
+export default new Vuex.Store({
+  state: {
+
+  },
+  mutations: {
+
+  },
+  actions: {
+
+  }
+})