Kaynağa Gözat

时间控件bug修改:选择后清空再初始选中一栏确定,再打开显示不对应

zhouna 5 yıl önce
ebeveyn
işleme
dc7bb8dbfe
1 değiştirilmiş dosya ile 6 ekleme ve 4 silme
  1. 6 4
      src/common/Picker.vue

+ 6 - 4
src/common/Picker.vue

@@ -75,10 +75,12 @@
       },
       handlechange(picker, value, colum){//关掉提示
         this.showTip = false;
-        if(colum == 2){
-          this.columIndx[colum] = unit.lastIndexOf(value[colum]);
-        }else{
-          this.columIndx[colum] = num.lastIndexOf(value[colum]);
+        for(let i=0;i<3;i++){
+          if(colum == 2){
+            this.columIndx[i] = unit.lastIndexOf(value[i]);
+          }else{
+            this.columIndx[i] = num.lastIndexOf(value[i]);
+          }
         }
       },
       resetIndex(){//清除时复原默认index