zhangjie 2 년 전
부모
커밋
4f2a15fe8e
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/modules/question/components/import-edit/TextAnswerQuestion.vue

+ 8 - 2
src/modules/question/components/import-edit/TextAnswerQuestion.vue

@@ -79,7 +79,9 @@ export default {
     initData() {
       this.modalForm = this.$objAssign(getInitQuestionModel(), this.question);
       this.initAnswer(this.question.quesAnswer);
-      this.quesAnswer = this.modalForm.quesAnswer[0] || null;
+      this.quesAnswer = this.modalForm.quesAnswer[0] || {
+        sections: [],
+      };
     },
     initAnswer(answer) {
       let quesAnswer = [];
@@ -92,7 +94,11 @@ export default {
       }
       if (this.checkAnswerFormatValid(quesAnswer)) {
         this.modalForm.quesAnswer = quesAnswer.map((item) =>
-          isAnEmptyRichText(item) ? null : item
+          isAnEmptyRichText(item)
+            ? {
+                sections: [],
+              }
+            : item
         );
       } else {
         this.modalForm.quesAnswer = [];