fixed #4895
This commit is contained in:
parent
f308dcac80
commit
4a8826fa02
2 changed files with 32 additions and 2 deletions
|
@ -106,7 +106,8 @@
|
|||
draggable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
beforeClose: Function,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
|
@ -176,6 +177,21 @@
|
|||
},
|
||||
methods: {
|
||||
close () {
|
||||
if (!this.beforeClose) {
|
||||
return this.handleClose();
|
||||
}
|
||||
|
||||
const before = this.beforeClose();
|
||||
|
||||
if (before && before.then) {
|
||||
before.then(() => {
|
||||
this.handleClose();
|
||||
});
|
||||
} else {
|
||||
this.handleClose();
|
||||
}
|
||||
},
|
||||
handleClose () {
|
||||
this.visible = false;
|
||||
this.$emit('input', false);
|
||||
this.$emit('on-close');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue