From 3a19bdd1915ee10aa5cee8a5bfd07f83d351e700 Mon Sep 17 00:00:00 2001 From: Leopoldthecoder Date: Thu, 4 May 2017 20:15:32 +0800 Subject: [PATCH] Dialog: fix visible.sync compatibility with before-close --- packages/dialog/src/component.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/dialog/src/component.vue b/packages/dialog/src/component.vue index 1086ea74a..0f1dc0a31 100644 --- a/packages/dialog/src/component.vue +++ b/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');