sadais-piui 1.2.7-beta113 → 1.2.7-beta114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/pi-input/index.vue +13 -5
- package/config/input.js +2 -1
- package/package.json +1 -1
|
@@ -280,6 +280,12 @@ export default {
|
|
|
280
280
|
default() {
|
|
281
281
|
return input.clearIcon
|
|
282
282
|
}
|
|
283
|
+
},
|
|
284
|
+
// 是否失去焦点更新v-model
|
|
285
|
+
updateOnBlur: {
|
|
286
|
+
type: Boolean,
|
|
287
|
+
// true
|
|
288
|
+
default: input.updateOnBlur
|
|
283
289
|
}
|
|
284
290
|
},
|
|
285
291
|
data() {
|
|
@@ -347,14 +353,16 @@ export default {
|
|
|
347
353
|
// 获得焦点
|
|
348
354
|
this.$emit('focus')
|
|
349
355
|
},
|
|
350
|
-
handleBlur() {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
356
|
+
handleBlur(e) {
|
|
357
|
+
const value = e.detail.value
|
|
358
|
+
if (this.updateOnBlur) {
|
|
359
|
+
this.handleChange(value)
|
|
360
|
+
}
|
|
354
361
|
this.$emit('blur', value)
|
|
355
362
|
setTimeout(() => {
|
|
363
|
+
this.focused = false
|
|
356
364
|
this.dispatch('PiFormItem', 'form-blur', value)
|
|
357
|
-
},
|
|
365
|
+
}, 100)
|
|
358
366
|
},
|
|
359
367
|
handleClearInput() {
|
|
360
368
|
this.handleChange('')
|
package/config/input.js
CHANGED