Explorar el Código

清空无文字选项选中状态

liucf hace 5 años
padre
commit
ce91a267bd
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      src/components/Detail.vue

+ 3 - 2
src/components/Detail.vue

@@ -172,7 +172,8 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
         this.$store.commit('setDetail',{detail:{}})
       },
       clearData(){//清空
-        const datas = this.checkDatas.questionMapping;
+        // const datas = this.checkDatas.questionMapping;
+        const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
         let reqFlag = false;//必填项标识
         for(let i in datas){
           datas[i].value = "";
@@ -191,7 +192,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
             }
           }
         }
-
+        
         this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
         // 已有选中内容重新进来,点清空时并非真的清空
         if(this.checkDatas.select ==1){return}