Prechádzať zdrojové kódy

考试填空题简答去除首尾空格

cyy 8 mesiacov pred
rodič
commit
14670890b3

+ 3 - 3
src/views/platform/bpmn/my-test/examPop.vue

@@ -117,7 +117,7 @@
                   <van-field
                       v-for="(item, index) in popList[questionsIndex].options"
                       :key="'tian'+index"
-                      v-model="item.answer"
+                      v-model.trim="item.answer"
                       placeholder="请输入内容"
                       :border="true"
                       clearable
@@ -129,7 +129,7 @@
                 <!-- 简答题 -->
                  <div v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='简答题'">
                     <van-field
-                        v-model="popListAnswer[questionsIndex]"
+                        v-model.trim="popListAnswer[questionsIndex]"
                         placeholder="请输入内容"
                         type="textarea"
                         :border="true"
@@ -587,8 +587,8 @@ export default {
 
     },
     fieleInput(val, qIndex, aIndex) {
+      val = val.replace(/^\s+|s+$/g, '')
       if (this.popList[qIndex].questionType === '填空题' && val !== '') {
-        // this.popListAnswer[qIndex][aIndex] = val
         this.$set(this.popListAnswer[qIndex], aIndex, val)
       }
     },