Update questions data using computed

When I click another language option in quiz component,
the quiz sentence is not changed to another language.
So I refactor questions 'data' to 'computed'
pull/141/head
DaehunGwak 4 years ago
parent 79f64f4cba
commit 764ce644fa

@ -28,15 +28,20 @@
import messages from "@/assets/translations"; import messages from "@/assets/translations";
export default { export default {
name: "Quiz",
data() { data() {
return { return {
currentQuestion: 0, currentQuestion: 0,
complete: false, complete: false,
error: false, error: false,
route: "", route: "",
questions: this.$t("quizzes"),
}; };
}, },
computed: {
questions() {
return this.$t("quizzes");
}
},
i18n: { messages }, i18n: { messages },
methods: { methods: {

Loading…
Cancel
Save