Commit 6a971099e9ac2e8acb28771a9b2a0cfe64982737

Authored by 梁灏
1 parent 76ae3e88

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

Showing 1 changed file with 11 additions and 0 deletions   Show diff stats
src/components/poptip/poptip.vue
@@ -111,6 +111,11 @@ @@ -111,6 +111,11 @@
111 // default by css: 8px 16px 111 // default by css: 8px 16px
112 padding: { 112 padding: {
113 type: String 113 type: String
  114 + },
  115 + // 3.4.0
  116 + disabled: {
  117 + type: Boolean,
  118 + default: false
114 } 119 }
115 }, 120 },
116 data () { 121 data () {
@@ -181,6 +186,8 @@ @@ -181,6 +186,8 @@
181 }, 186 },
182 methods: { 187 methods: {
183 handleClick () { 188 handleClick () {
  189 + if (this.disabled) return;
  190 +
184 if (this.confirm) { 191 if (this.confirm) {
185 this.visible = !this.visible; 192 this.visible = !this.visible;
186 return true; 193 return true;
@@ -208,6 +215,8 @@ @@ -208,6 +215,8 @@
208 this.visible = false; 215 this.visible = false;
209 }, 216 },
210 handleFocus (fromInput = true) { 217 handleFocus (fromInput = true) {
  218 + if (this.disabled) return;
  219 +
211 if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) { 220 if (this.trigger !== 'focus' || this.confirm || (this.isInput && !fromInput)) {
212 return false; 221 return false;
213 } 222 }
@@ -220,6 +229,8 @@ @@ -220,6 +229,8 @@
220 this.visible = false; 229 this.visible = false;
221 }, 230 },
222 handleMouseenter () { 231 handleMouseenter () {
  232 + if (this.disabled) return;
  233 +
223 if (this.trigger !== 'hover' || this.confirm) { 234 if (this.trigger !== 'hover' || this.confirm) {
224 return false; 235 return false;
225 } 236 }