Преглед на файлове

Dialog: fix visible.sync compatibility with before-close

Leopoldthecoder преди 8 години
родител
ревизия
3a19bdd191
променени са 1 файла, в които са добавени 6 реда и са изтрити 2 реда
  1. 6 2
      packages/dialog/src/component.vue

+ 6 - 2
packages/dialog/src/component.vue

@@ -117,11 +117,15 @@
       },
       handleClose() {
         if (typeof this.beforeClose === 'function') {
-          this.beforeClose(this.close);
+          this.beforeClose(this.hide);
         } else {
-          this.close();
+          this.hide();
         }
       },
+      hide() {
+        this.$emit('update:visible', false);
+        this.$emit('visible-change', false);
+      },
       updatePopper() {
         this.broadcast('ElSelectDropdown', 'updatePopper');
         this.broadcast('ElDropdownMenu', 'updatePopper');