hungergames/src/views/Quest.vue

36 lines
828 B
Vue
Raw Normal View History

2017-09-29 18:12:00 +02:00
<template>
<QuestMissingCategories v-if="questData" :data="questData" :onSubmit="validateQuest" />
2017-09-29 18:12:00 +02:00
</template>
<script>
import QuestMissingCategories from '@/components/QuestMissingCategories/index';
2017-10-22 21:20:58 +02:00
// TODO: Changing route should not flash old product
2017-09-29 18:12:00 +02:00
export default {
components: {
QuestMissingCategories,
},
created() {
this.fetchData();
},
methods: {
fetchData() {
this.$store.dispatch('preloadQuests');
},
validateQuest(solution) {
this.$store.dispatch('validateQuest', {
type: this.questData.type,
id: this.questData.id,
solution,
});
},
2017-09-29 18:12:00 +02:00
},
computed: {
questData() {
return this.$store.getters.popQuest;
},
},
};
</script>