Poptip add disabled prop, fix #5520 ,close #5575

This commit is contained in:
梁灏 2019-04-09 09:21:21 +08:00
parent 76ae3e8853
commit 6a971099e9

View file

@ -111,6 +111,11 @@
// default by css: 8px 16px
padding: {
type: String
},
// 3.4.0
disabled: {
type: Boolean,
default: false
}
},
data () {
@ -181,6 +186,8 @@
},
methods: {
handleClick () {
if (this.disabled) return;
if (this.confirm) {
this.visible = !this.visible;
return true;
@ -208,6 +215,8 @@
this.visible = false;
},
handleFocus (fromInput = true) {
if (this.disabled) return;
if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {
return false;
}
@ -220,6 +229,8 @@
this.visible = false;
},
handleMouseenter () {
if (this.disabled) return;
if (this.trigger !== 'hover' || this.confirm) {
return false;
}