From 6a971099e9ac2e8acb28771a9b2a0cfe64982737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E7=81=8F?= Date: Tue, 9 Apr 2019 09:21:21 +0800 Subject: [PATCH] Poptip add disabled prop, fix #5520 ,close #5575 --- src/components/poptip/poptip.vue | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/poptip/poptip.vue b/src/components/poptip/poptip.vue index 184473fe..333a0428 100644 --- a/src/components/poptip/poptip.vue +++ b/src/components/poptip/poptip.vue @@ -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; }