mirror of
https://github.com/microsoft/Web-Dev-For-Beginners.git
synced 2025-08-25 23:56:22 +02:00
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:
@@ -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: {
|
||||
|
Reference in New Issue
Block a user