Dialog: add closeOnDeactivated attribute

pull/20977/head
温贝 2021-04-29 10:47:19 +08:00
parent 17de41f3e2
commit 48754b716a
1 changed files with 10 additions and 0 deletions

View File

@ -88,6 +88,11 @@
default: true
},
closeOnDeactivated: {
type: Boolean,
default: true
},
width: String,
fullscreen: Boolean,
@ -202,6 +207,11 @@
}
},
deactivated() {
if (!this.closeOnDeactivated || !this.visible) return;
this.hide();
},
destroyed() {
// if appendToBody is true, remove DOM node after destroy
if (this.appendToBody && this.$el && this.$el.parentNode) {