|
@@ -293,8 +293,10 @@ export default {
|
|
deleteQuestion() {
|
|
deleteQuestion() {
|
|
DeleteQuestion({ question_id: this.index_list[this.curIndex].id })
|
|
DeleteQuestion({ question_id: this.index_list[this.curIndex].id })
|
|
.then(() => {
|
|
.then(() => {
|
|
- this.curIndex = Math.max(0, this.curIndex - 1);
|
|
|
|
- this.getExerciseQuestionIndexList();
|
|
|
|
|
|
+ let index = this.curIndex - 1;
|
|
|
|
+ this.curIndex = Math.max(0, index);
|
|
|
|
+ // 当删除的题目是第一题时,需要重新获取题目信息,因为 curIndex 没有变化
|
|
|
|
+ this.getExerciseQuestionIndexList(index < 0);
|
|
this.$message.success('删除成功');
|
|
this.$message.success('删除成功');
|
|
})
|
|
})
|
|
.catch(() => {
|
|
.catch(() => {
|