瀏覽代碼

DatePicker: close timepicker before dodestroy

Dreamacro 8 年之前
父節點
當前提交
df16836163
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      packages/date-picker/src/panel/date.vue

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

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