From 0b6618c2348640dfb29acbfefcf9a0cd032856b2 Mon Sep 17 00:00:00 2001 From: pawlaczyk Date: Sat, 5 Jan 2019 15:36:36 +0100 Subject: [PATCH] dodanie central store --- frontend/app/package-lock.json | 5 +++++ frontend/app/package.json | 3 ++- frontend/app/src/components/Navbar.vue | 12 ++++++------ frontend/app/src/main.js | 2 ++ frontend/app/src/store/store.js | 17 +++++++++++++++++ frontend/app/src/views/Cards.vue | 3 +++ frontend/app/src/views/Game.vue | 3 +++ frontend/app/src/views/Login.vue | 3 +++ frontend/app/src/views/Logout.vue | 3 +++ frontend/app/src/views/Users.vue | 3 +++ 10 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 frontend/app/src/store/store.js diff --git a/frontend/app/package-lock.json b/frontend/app/package-lock.json index 535ddd4..7e21082 100644 --- a/frontend/app/package-lock.json +++ b/frontend/app/package-lock.json @@ -10510,6 +10510,11 @@ "loader-utils": "^1.1.0" } }, + "vuex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz", + "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==" + }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", diff --git a/frontend/app/package.json b/frontend/app/package.json index 15321ee..3ceca97 100644 --- a/frontend/app/package.json +++ b/frontend/app/package.json @@ -11,7 +11,8 @@ "date-fns": "^1.30.1", "vue": "^2.5.21", "vue-router": "^3.0.1", - "vuetify": "^1.3.0" + "vuetify": "^1.3.0", + "vuex": "^3.0.1" }, "devDependencies": { "@vue/cli-plugin-babel": "^3.2.0", diff --git a/frontend/app/src/components/Navbar.vue b/frontend/app/src/components/Navbar.vue index 87dcfd3..1a516b3 100644 --- a/frontend/app/src/components/Navbar.vue +++ b/frontend/app/src/components/Navbar.vue @@ -46,7 +46,7 @@ -

Edżentelmen

+

Edżentelmeni

@@ -75,14 +75,14 @@ export default { data(){ return{ drawer: false, //niepokazywac na poczatku - links: [ - { icon: 'dashboard', text: 'Rozgrywka', route: '/'}, - { icon: "folder", text: 'Karty', route: '/projects'}, - { icon: 'person', text: 'Dżentelmani', route: '/team'} - ], snackbar: false } }, + computed:{ + links(){ + return this.$store.state.links; + } + }, methods:{ userLogout(){ //wylogowanie diff --git a/frontend/app/src/main.js b/frontend/app/src/main.js index 3a1fca9..4fc4319 100644 --- a/frontend/app/src/main.js +++ b/frontend/app/src/main.js @@ -2,10 +2,12 @@ import Vue from 'vue' import './plugins/vuetify' import App from './App.vue' import router from './router' +import {store} from './store/store' Vue.config.productionTip = false new Vue({ router, + store: store, render: h => h(App) }).$mount('#app') diff --git a/frontend/app/src/store/store.js b/frontend/app/src/store/store.js new file mode 100644 index 0000000..c63c467 --- /dev/null +++ b/frontend/app/src/store/store.js @@ -0,0 +1,17 @@ +import Vue from 'vue'; +import Vuex from 'vuex'; + +Vue.use(Vuex); + +export const store = new Vuex.Store({ + state: { + links:[ + { icon: 'dashboard', text: 'Gra', route: '/'}, + { icon: "folder", text: 'Karty', route: '/karty'}, + { icon: 'person', text: 'Dżentelmani', route: '/dzentelmani'}, + // { icon: 'exit_to_app', text: 'Wyloguj', route: '/logout'}, + // { icon: 'get_app', text: 'Zaloguj', route: '/login'}, + // { icon: 'account_circle', text: 'Rejestracja', route: '/register'}, + ] + } +}) diff --git a/frontend/app/src/views/Cards.vue b/frontend/app/src/views/Cards.vue index e69de29..16f6329 100644 --- a/frontend/app/src/views/Cards.vue +++ b/frontend/app/src/views/Cards.vue @@ -0,0 +1,3 @@ + diff --git a/frontend/app/src/views/Game.vue b/frontend/app/src/views/Game.vue index e69de29..86ca531 100644 --- a/frontend/app/src/views/Game.vue +++ b/frontend/app/src/views/Game.vue @@ -0,0 +1,3 @@ + diff --git a/frontend/app/src/views/Login.vue b/frontend/app/src/views/Login.vue index e69de29..da9a956 100644 --- a/frontend/app/src/views/Login.vue +++ b/frontend/app/src/views/Login.vue @@ -0,0 +1,3 @@ + diff --git a/frontend/app/src/views/Logout.vue b/frontend/app/src/views/Logout.vue index e69de29..b1ab46e 100644 --- a/frontend/app/src/views/Logout.vue +++ b/frontend/app/src/views/Logout.vue @@ -0,0 +1,3 @@ + diff --git a/frontend/app/src/views/Users.vue b/frontend/app/src/views/Users.vue index e69de29..6a4a014 100644 --- a/frontend/app/src/views/Users.vue +++ b/frontend/app/src/views/Users.vue @@ -0,0 +1,3 @@ +