Dialog: Revert Fix close bug (#15000) (#15544) (#16201)

This reverts commit 562662773e.
This commit is contained in:
Zhi Cun 2019-06-24 16:04:20 +08:00 committed by GitHub
parent 562662773e
commit b9ecabbf05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
name="dialog-fade"
@after-enter="afterEnter"
@after-leave="afterLeave">
<div class="el-dialog__wrapper" v-show="visible" @click.self="handleWrapperClick" @mouseup="handleMouseup">
<div class="el-dialog__wrapper" v-show="visible" @click.self="handleWrapperClick">
<div
role="dialog"
aria-modal="true"
@ -11,8 +11,7 @@
class="el-dialog"
:class="[{ 'is-fullscreen': fullscreen, 'el-dialog--center': center }, customClass]"
ref="dialog"
:style="style"
@mousedown="handleMousedown">
:style="style">
<div class="el-dialog__header">
<slot name="title">
<span class="el-dialog__title">{{ title }}</span>
@ -40,8 +39,6 @@
import Migrating from 'element-ui/src/mixins/migrating';
import emitter from 'element-ui/src/mixins/emitter';
let dialogMouseDown = false;
export default {
name: 'ElDialog',
@ -155,19 +152,9 @@
};
},
handleWrapperClick() {
if (!this.closeOnClickModal || dialogMouseDown) return;
if (!this.closeOnClickModal) return;
this.handleClose();
},
handleMousedown() {
dialogMouseDown = true;
},
handleMouseup() {
if (dialogMouseDown) {
this.$nextTick(_ => {
dialogMouseDown = false;
});
}
},
handleClose() {
if (typeof this.beforeClose === 'function') {
this.beforeClose(this.hide);