dusenyao 1 рік тому
батько
коміт
5d0dcd18d6

+ 3 - 0
src/views/exercise_questions/create/components/common/QuestionMixin.js

@@ -24,6 +24,7 @@ const mixin = {
       isEnable,
       questionNumberTypeList,
       computedQuestionNumber,
+      isGetInfo: false, // 是否获取题目信息
     };
   },
   provide: ['refreshPreviewData'],
@@ -59,6 +60,7 @@ const mixin = {
           this.data = JSON.parse(question.content);
           this.$emit('loaded');
           this.refreshPreviewData();
+          this.isGetInfo = true;
         })
         .catch(() => {});
     }
@@ -83,6 +85,7 @@ const mixin = {
   },
   methods: {
     saveChildQuestion() {
+      if (!this.isGetInfo) return;
       SaveQuestion({
         question_id: this.questionId,
         type: this.data.type,