covidassist/src/views/HelpPage.vue

54 lines
1.3 KiB
Vue
Raw Normal View History

<style scoped>
.help {
padding: 1em;
}
2020-03-22 19:01:06 +01:00
@media screen and (min-width : 906px) {
.help {
width: 600px;
2020-03-22 19:01:06 +01:00
margin-left: auto;
margin-right: auto;
}
}
button {
width: 80%;
margin-bottom: 5%;
}
</style>
2020-03-21 16:40:32 +01:00
<template>
<div class="help">
<p>{{ $store.state.questions[$route.params.id].description }}</p>
<div class="button-wrapper">
<router-link v-bind:to="'/questionnaire/' + $route.params.id"><button>Zurück zur Frage</button></router-link>
<br><br>
<button v-on:click="nextQuestion()" class="alert">Ich möchte diese Frage überspringen</button>
2020-03-21 16:40:32 +01:00
</div>
</div>
2020-03-21 16:40:32 +01:00
</template>
<script>
2020-03-22 14:21:58 +01:00
import router from "@/router";
2020-03-21 16:40:32 +01:00
export default {
name: "HelpPage",
props: {
text: String
2020-03-22 14:21:58 +01:00
},
methods: {
nextQuestion() {
2020-03-22 22:08:45 +01:00
this.$store.commit("setSkipped", this.$route.params.id)
2020-03-22 14:21:58 +01:00
if (this.$route.params.id < this.$store.state.questions.length - 1) {
const nextQuestion = parseInt(this.$route.params.id) + 1
this.$router.push("/questionnaire/" + nextQuestion)
}
else {
this.$store.commit("setSurveyCompleted")
2020-03-22 14:21:58 +01:00
router.push('/results')
}
},
},
}
2020-03-21 16:40:32 +01:00
</script>