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'
This commit is contained in:
DaehunGwak
2020-12-31 03:03:52 +09:00
parent 79f64f4cba
commit 764ce644fa

View File

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