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