Răsfoiți Sursa

DatePicker: close timepicker before dodestroy

Dreamacro 8 ani în urmă
părinte
comite
df16836163
1 a modificat fișierele cu 6 adăugiri și 1 ștergeri
  1. 6 1
      packages/date-picker/src/panel/date.vue

+ 6 - 1
packages/date-picker/src/panel/date.vue

@@ -1,5 +1,5 @@
 <template>
 <template>
-  <transition name="el-zoom-in-top" @after-leave="$emit('dodestroy')">
+  <transition name="el-zoom-in-top" @after-leave="afterLeave">
     <div
     <div
       v-show="visible"
       v-show="visible"
       :style="{
       :style="{
@@ -342,6 +342,11 @@
           this.year = this.date.getFullYear();
           this.year = this.date.getFullYear();
           this.month = this.date.getMonth();
           this.month = this.date.getMonth();
         }
         }
+      },
+
+      afterLeave() {
+        this.$refs.timepicker.handleConfirm();
+        this.$emit('dodestroy');
       }
       }
     },
     },