sadais-piui 1.2.7-beta110 → 1.2.7-beta111
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.
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
:auto-height="autoHeight"
|
|
38
38
|
:disable-default-padding="disableDefaultPadding"
|
|
39
39
|
@focus="handleFocus"
|
|
40
|
+
@input="handleInput"
|
|
40
41
|
@blur="handleBlur"
|
|
41
42
|
@confirm="handleConfirm"
|
|
42
43
|
@keyboardheightchange="$emit('keyboardheightchange', $event)"
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
:hold-keyboard="holdKeyboard"
|
|
67
68
|
:auto-blur="autoBlur"
|
|
68
69
|
@focus="handleFocus"
|
|
70
|
+
@input="handleInput"
|
|
69
71
|
@blur="handleBlur"
|
|
70
72
|
@confirm="handleConfirm"
|
|
71
73
|
@keyboardheightchange="$emit('keyboardheightchange', $event)"
|
|
@@ -278,6 +280,12 @@ export default {
|
|
|
278
280
|
default() {
|
|
279
281
|
return input.clearIcon
|
|
280
282
|
}
|
|
283
|
+
},
|
|
284
|
+
// 是否失去焦点更新v-model
|
|
285
|
+
updateOnBlur: {
|
|
286
|
+
type: Boolean,
|
|
287
|
+
// true
|
|
288
|
+
default: input.updateOnBlur
|
|
281
289
|
}
|
|
282
290
|
},
|
|
283
291
|
data() {
|
|
@@ -336,6 +344,12 @@ export default {
|
|
|
336
344
|
handleItemClick(e) {
|
|
337
345
|
this.$emit('click', e)
|
|
338
346
|
},
|
|
347
|
+
handleInput: debounce(function(e) {
|
|
348
|
+
if (this.updateOnBlur) return
|
|
349
|
+
let value = e.detail.value
|
|
350
|
+
// 输入内容
|
|
351
|
+
this.handleChange(value)
|
|
352
|
+
}, 50),
|
|
339
353
|
handleFocus() {
|
|
340
354
|
this.focused = true
|
|
341
355
|
// 获得焦点
|
|
@@ -343,7 +357,9 @@ export default {
|
|
|
343
357
|
},
|
|
344
358
|
handleBlur(e) {
|
|
345
359
|
const value = e.detail.value
|
|
346
|
-
this.
|
|
360
|
+
if (this.updateOnBlur) {
|
|
361
|
+
this.handleChange(value)
|
|
362
|
+
}
|
|
347
363
|
setTimeout(() => {
|
|
348
364
|
this.focused = false
|
|
349
365
|
}, 100)
|
package/config/input.js
CHANGED
package/config/uploadImg.js
CHANGED
|
@@ -53,6 +53,7 @@ export default {
|
|
|
53
53
|
// 当type为 "image"时生效,调用uni.chooseImage参数
|
|
54
54
|
chooseImageOpts: {
|
|
55
55
|
sourceType: ['album', 'camera'], // album 从相册选图,camera 使用相机,默认album
|
|
56
|
+
extension: [], // 允许上传的文件类型,不填则不限制
|
|
56
57
|
sizeType: ['original', 'compressed'], // original 原图,compressed 压缩图,默认compressed
|
|
57
58
|
crop: {} // 图像裁剪参数,设置后 sizeType 失效
|
|
58
59
|
},
|