瀏覽代碼

清空无文字选项选中状态

liucf 5 年之前
父節點
當前提交
ce91a267bd
共有 1 個文件被更改,包括 3 次插入2 次删除
  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:{}})
         this.$store.commit('setDetail',{detail:{}})
       },
       },
       clearData(){//清空
       clearData(){//清空
-        const datas = this.checkDatas.questionMapping;
+        // const datas = this.checkDatas.questionMapping;
+        const datas = JSON.parse(JSON.stringify(this.checkDatas.questionMapping))
         let reqFlag = false;//必填项标识
         let reqFlag = false;//必填项标识
         for(let i in datas){
         for(let i in datas){
           datas[i].value = "";
           datas[i].value = "";
@@ -191,7 +192,7 @@ import {patt,trimDots,imageUrlPrefix} from '@utils/tools.js'
             }
             }
           }
           }
         }
         }
-
+        
         this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
         this.checkDatas = Object.assign({},this.checkDatas,{questionMapping:datas});
         // 已有选中内容重新进来,点清空时并非真的清空
         // 已有选中内容重新进来,点清空时并非真的清空
         if(this.checkDatas.select ==1){return}
         if(this.checkDatas.select ==1){return}