Explorar o código

Dialog: fix visible.sync compatibility with before-close

Leopoldthecoder %!s(int64=8) %!d(string=hai) anos
pai
achega
3a19bdd191
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  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');