Browse Source

Add vuex

vuex
Schneider 7 years ago
parent
commit
46e6dbb97c
  1. 5
      package-lock.json
  2. 3
      package.json
  3. 4
      src/main.js
  4. 13
      src/store/index.js

5
package-lock.json

@ -10237,6 +10237,11 @@
"integrity": "sha1-oKbFDJQdKkq9qWPy9CwzesRQ7pU=",
"dev": true
},
"vuex": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz",
"integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w=="
},
"watchpack": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.5.0.tgz",

3
package.json

@ -12,7 +12,8 @@
},
"dependencies": {
"vue": "^2.2.2",
"vue-router": "^2.3.0"
"vue-router": "^2.3.0",
"vuex": "^3.0.1"
},
"devDependencies": {
"autoprefixer": "^6.7.2",

4
src/main.js

@ -1,6 +1,7 @@
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store/index.js'
Vue.config.productionTip = false
@ -8,5 +9,6 @@ Vue.config.productionTip = false
new Vue({
el: '#app',
router,
render: h => h(App)
render: h => h(App),
store
})

13
src/store/index.js

@ -0,0 +1,13 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const state = {
where: 'zentralmensa',
day: new Date().getDay() || 1
}
export default new Vuex.Store({
state
})
Loading…
Cancel
Save