feat: add modal prop to Poptip

This commit is contained in:
yison 2019-02-14 17:54:52 +08:00
parent 215bea1818
commit d0bd2b5dfb

View file

@ -111,7 +111,12 @@
// default by css: 8px 16px // default by css: 8px 16px
padding: { padding: {
type: String type: String
} },
//
modal: {
type: Boolean,
default: false,
},
}, },
data () { data () {
return { return {
@ -194,18 +199,20 @@
if (this.transfer) this.disableCloseUnderTransfer = true; if (this.transfer) this.disableCloseUnderTransfer = true;
}, },
handleClose () { handleClose () {
if (this.disableCloseUnderTransfer) { if (!this.modal) {
this.disableCloseUnderTransfer = false; if (this.disableCloseUnderTransfer) {
return false; this.disableCloseUnderTransfer = false;
} return false;
if (this.confirm) { }
if (this.confirm) {
this.visible = false;
return true;
}
if (this.trigger !== 'click') {
return false;
}
this.visible = false; this.visible = false;
return true;
} }
if (this.trigger !== 'click') {
return false;
}
this.visible = false;
}, },
handleFocus (fromInput = true) { handleFocus (fromInput = true) {
if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) { if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {