From 46e6dbb97c8f70dc02becef88214814daed50ae7 Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Thu, 5 Apr 2018 20:53:49 +0200 Subject: [PATCH] Add vuex --- package-lock.json | 5 +++++ package.json | 3 ++- src/main.js | 4 +++- src/store/index.js | 13 +++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/store/index.js diff --git a/package-lock.json b/package-lock.json index 4e79f98..9bd3509 100644 --- a/package-lock.json +++ b/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", diff --git a/package.json b/package.json index f6ee833..5048b6c 100644 --- a/package.json +++ b/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", diff --git a/src/main.js b/src/main.js index 254e5c9..479994d 100644 --- a/src/main.js +++ b/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 }) diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..a559b01 --- /dev/null +++ b/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 +})