From de12ea3f4bede38b6201218518dfbd483bdfdad8 Mon Sep 17 00:00:00 2001 From: thilo Date: Sat, 21 Mar 2020 17:11:07 +0100 Subject: [PATCH] add missing sourcecode --- src/router/index.js | 31 +++++++++++++++++++++++++++++++ src/store/index.js | 31 +++++++++++++++++++++++++++++++ src/views/Home.vue | 32 ++++++++++++++++++++++++++++++++ src/views/Warning.vue | 16 ++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 src/router/index.js create mode 100644 src/store/index.js create mode 100644 src/views/Home.vue create mode 100644 src/views/Warning.vue diff --git a/src/router/index.js b/src/router/index.js new file mode 100644 index 0000000..8fa89ff --- /dev/null +++ b/src/router/index.js @@ -0,0 +1,31 @@ +import Vue from 'vue' +import VueRouter from 'vue-router' +import Home from '../views/Home.vue' +import Warning from '../views/Warning' +import Questionnaire from "@/views/Questionnaire"; + +Vue.use(VueRouter) + +const routes = [ + { + path: '/', + name: 'Home', + component: Home + }, + { + path: '/warning', + name: 'Warnung', + component: Warning + }, + { + path: '/questionmaire', + name: 'Fragebogen', + component: Questionnaire + } +] + +const router = new VueRouter({ + routes +}) + +export default router diff --git a/src/store/index.js b/src/store/index.js new file mode 100644 index 0000000..650df02 --- /dev/null +++ b/src/store/index.js @@ -0,0 +1,31 @@ +import Vue from 'vue' +import Vuex from 'vuex' + +Vue.use(Vuex) + +export default new Vuex.Store({ + state: { + currentQuestion: 0, + answers: [], + questions: [{ + question: "Test", + answers: ["Answer 1", "Answer 2", "Answer 3"] + }] + }, + mutations: { + nextQuestion() { + if(this.state.currentQuestion <= + this.state.questions.length - 1) + this.state.currentQuestion += 1 + }, + previousQuestion() { + if(this.state.currentQuestion > 0) { + this.state.currentQuestion -= 1 + } + } + }, + actions: { + }, + modules: { + } +}) diff --git a/src/views/Home.vue b/src/views/Home.vue new file mode 100644 index 0000000..ba47046 --- /dev/null +++ b/src/views/Home.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/views/Warning.vue b/src/views/Warning.vue new file mode 100644 index 0000000..3f8357a --- /dev/null +++ b/src/views/Warning.vue @@ -0,0 +1,16 @@ + + +