Procházet zdrojové kódy

fix 字数跟随输入增长

Michael Wang před 5 roky
rodič
revize
63a411b01e

+ 2 - 2
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -224,7 +224,7 @@ export default {
       this.studentAnswer = this.$refs.answerDiv.innerHTML;
     },
     textInput($event) {
-      console.log($event.target.innerHTML);
+      // console.log($event.target.innerHTML);
       this.studentAnswer = $event.target.innerHTML;
     },
     showAnswer() {
@@ -321,7 +321,7 @@ export default {
       return this.question.rightAnswer.join("");
     },
     answerWordCount() {
-      if (this.$refs.answerDiv) {
+      if (this.studentAnswer && this.$refs.answerDiv) {
         return this.$refs.answerDiv.innerText.length;
       } else {
         const ele = document.createElement("div");