sadais-piui 1.2.7-beta112 → 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.
@@ -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
- setTimeout(() => {
352
- this.focused = false
353
- }, 100)
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
- }, 40)
365
+ }, 100)
358
366
  },
359
367
  handleClearInput() {
360
368
  this.handleChange('')
@@ -1,7 +1,7 @@
1
1
  <!--
2
2
  * @Author: zhangzhenfei
3
3
  * @Date: 2021-08-13 11:31:57
4
- * @LastEditTime: 2024-06-11 09:52:29
4
+ * @LastEditTime: 2024-06-11 11:39:08
5
5
  * @LastEditors: zhangzhenfei
6
6
  * @Description: 图片上传组件
7
7
  * @FilePath: /piui-awesome/src/piui/components/pi-upload-img/index.vue
@@ -9,9 +9,9 @@
9
9
 
10
10
  <template>
11
11
  <view
12
- class="pi-upload-img pi-pd-top-12"
12
+ class="pi-upload-img"
13
13
  :style="[customStyle]"
14
- :class="[customClass]"
14
+ :class="[customClass, { 'pi-pd-top-12': !getDisabled }]"
15
15
  >
16
16
  <!-- 已上传图片展示 -->
17
17
  <view
@@ -756,7 +756,6 @@ export default {
756
756
  const [, result] = await uni.chooseFile({
757
757
  count: this.getUploadMaxCount,
758
758
  sizeType,
759
- extension: this.getExtension,
760
759
  sourceType,
761
760
  crop
762
761
  })
@@ -814,7 +813,6 @@ export default {
814
813
  const [, result] = await uni.chooseImage({
815
814
  count: this.getUploadMaxCount,
816
815
  sizeType,
817
- extension: this.getExtension,
818
816
  sourceType,
819
817
  crop
820
818
  })
package/config/input.js CHANGED
@@ -32,5 +32,6 @@ export default {
32
32
  size: 36,
33
33
  name: 'close-line',
34
34
  color: '#999999'
35
- }
35
+ },
36
+ updateOnBlur: true // 为false时,输入时更新 v-model,为true时,失焦时更新 v-model
36
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sadais-piui",
3
- "version": "1.2.7-beta112",
3
+ "version": "1.2.7-beta114",
4
4
  "description": "piui组件库",
5
5
  "main": "index.js",
6
6
  "scripts": {