我试图totalQuestions
在 html 中绑定变量的更新值。但它显示以下错误。谁能告诉我我哪里做错了。
HTML
<label><span class="red-text">Question No: </span><span>1 out of {{totalQuestions}}</span>/</label>
多变的:
date() {
return {
examKey: '',
questionsIds: '',
duration: 0,
questionList: [],
totalQuestions: ''
}
},
方法
methods: {
loadQuestionSet: function() {
this.examKey = this.$route.params.key;
this.$http.get(baseUrl.BASE_URL + 'question-set/key/' + this.examKey).then(
(resp) => {
this.duration = resp.data.duration;
this.questionsIds = resp.data.questionIds;
this.loadQuestions();
},
(err) => {
this.$router.push("/exam");
}
);
},
loadQuestions: function() {
this.$http.post(baseUrl.BASE_URL + 'question/exam/questions', this.questionsIds).then(
(resp) => {
this.questionList = resp.data;
this.totalQuestions = this.questionList.length
},
(err) => {
console.log(err);
}
);
}
},
beforeMount: function() {
this.loadQuestionSet();
}
临摹微笑
相关分类