uview-plus 3.1.50 → 3.1.51

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.
Files changed (160) hide show
  1. package/README.md +10 -10
  2. package/changelog.md +15 -1
  3. package/components/u-action-sheet/props.js +10 -11
  4. package/components/u-album/props.js +11 -12
  5. package/components/u-alert/props.js +8 -9
  6. package/components/u-avatar/props.js +14 -15
  7. package/components/u-avatar-group/props.js +9 -10
  8. package/components/u-back-top/props.js +10 -11
  9. package/components/u-back-top/u-back-top.vue +1 -1
  10. package/components/u-badge/props.js +14 -15
  11. package/components/u-badge/u-badge.vue +1 -1
  12. package/components/u-button/props.js +28 -29
  13. package/components/u-button/vue.scss +8 -7
  14. package/components/u-calendar/month.vue +1 -1
  15. package/components/u-calendar/props.js +27 -28
  16. package/components/u-car-keyboard/props.js +0 -1
  17. package/components/u-car-keyboard/u-car-keyboard.vue +1 -1
  18. package/components/u-cell/props.js +17 -18
  19. package/components/u-cell/u-cell.vue +12 -3
  20. package/components/u-cell-group/props.js +2 -3
  21. package/components/u-cell-group/u-cell-group.vue +1 -1
  22. package/components/u-checkbox/props.js +13 -14
  23. package/components/u-checkbox/u-checkbox.vue +1 -1
  24. package/components/u-checkbox-group/props.js +16 -17
  25. package/components/u-circle-progress/props.js +1 -2
  26. package/components/u-code/props.js +6 -7
  27. package/components/u-code/u-code.vue +5 -0
  28. package/components/u-code-input/props.js +16 -17
  29. package/components/u-col/props.js +5 -6
  30. package/components/u-collapse/props.js +3 -4
  31. package/components/u-collapse-item/props.js +11 -12
  32. package/components/u-column-notice/props.js +10 -11
  33. package/components/u-count-down/props.js +4 -5
  34. package/components/u-count-down/u-count-down.vue +6 -1
  35. package/components/u-count-to/props.js +11 -12
  36. package/components/u-datetime-picker/props.js +37 -25
  37. package/components/u-datetime-picker/u-datetime-picker.vue +58 -3
  38. package/components/u-divider/props.js +8 -9
  39. package/components/u-dropdown/props.js +0 -1
  40. package/components/u-dropdown-item/props.js +0 -1
  41. package/components/u-empty/props.js +11 -12
  42. package/components/u-form/props.js +8 -9
  43. package/components/u-form/u-form.vue +1 -1
  44. package/components/u-form-item/props.js +13 -9
  45. package/components/u-form-item/u-form-item.vue +1 -0
  46. package/components/u-gap/props.js +4 -5
  47. package/components/u-grid/props.js +3 -4
  48. package/components/u-grid-item/props.js +2 -3
  49. package/components/u-grid-item/u-grid-item.vue +5 -0
  50. package/components/u-icon/props.js +17 -18
  51. package/components/u-icon/u-icon.vue +9 -6
  52. package/components/u-image/props.js +16 -17
  53. package/components/u-image/u-image.vue +1 -1
  54. package/components/u-index-anchor/props.js +5 -6
  55. package/components/u-index-anchor/u-index-anchor.vue +1 -1
  56. package/components/u-index-item/props.js +0 -1
  57. package/components/u-index-item/u-index-item.vue +1 -1
  58. package/components/u-index-list/props.js +5 -6
  59. package/components/u-index-list/u-index-list.vue +3 -2
  60. package/components/u-input/props.js +35 -36
  61. package/components/u-input/u-input.vue +10 -4
  62. package/components/u-keyboard/props.js +16 -17
  63. package/components/u-line/props.js +6 -7
  64. package/components/u-line-progress/props.js +5 -6
  65. package/components/u-link/props.js +7 -8
  66. package/components/u-list/props.js +14 -15
  67. package/components/u-list-item/props.js +1 -2
  68. package/components/u-loading-icon/props.js +11 -12
  69. package/components/u-loading-page/props.js +9 -10
  70. package/components/u-loadmore/props.js +18 -19
  71. package/components/u-modal/props.js +16 -17
  72. package/components/u-navbar/props.js +16 -17
  73. package/components/u-no-network/props.js +3 -4
  74. package/components/u-notice-bar/props.js +13 -14
  75. package/components/u-notify/props.js +9 -10
  76. package/components/u-notify/u-notify.vue +5 -0
  77. package/components/u-number-box/props.js +22 -23
  78. package/components/u-number-box/u-number-box.vue +21 -1
  79. package/components/u-number-keyboard/props.js +3 -4
  80. package/components/u-overlay/props.js +4 -5
  81. package/components/u-parse/props.js +8 -9
  82. package/components/u-parse/u-parse.vue +6 -1
  83. package/components/u-picker/props.js +16 -17
  84. package/components/u-picker-column/props.js +0 -1
  85. package/components/u-popup/props.js +15 -16
  86. package/components/u-qrcode/qrcode.js +1206 -0
  87. package/components/u-qrcode/u-qrcode.vue +199 -0
  88. package/components/u-radio/props.js +13 -14
  89. package/components/u-radio-group/props.js +17 -18
  90. package/components/u-rate/props.js +14 -15
  91. package/components/u-read-more/props.js +8 -9
  92. package/components/u-row/props.js +3 -4
  93. package/components/u-row-notice/props.js +7 -8
  94. package/components/u-row-notice/u-row-notice.vue +5 -0
  95. package/components/u-safe-bottom/props.js +0 -1
  96. package/components/u-scroll-list/props.js +6 -7
  97. package/components/u-search/props.js +24 -25
  98. package/components/u-skeleton/props.js +11 -12
  99. package/components/u-slider/props.js +11 -12
  100. package/components/u-status-bar/props.js +1 -2
  101. package/components/u-status-bar/u-status-bar.vue +1 -1
  102. package/components/u-steps/props.js +7 -8
  103. package/components/u-steps/u-steps.vue +1 -1
  104. package/components/u-steps-item/props.js +4 -5
  105. package/components/u-steps-item/u-steps-item.vue +1 -1
  106. package/components/u-sticky/props.js +6 -7
  107. package/components/u-sticky/u-sticky.vue +5 -0
  108. package/components/u-subsection/props.js +9 -10
  109. package/components/u-subsection/u-subsection.vue +2 -2
  110. package/components/u-swipe-action/props.js +1 -2
  111. package/components/u-swipe-action-item/nvue.js +5 -0
  112. package/components/u-swipe-action-item/props.js +6 -7
  113. package/components/u-swiper/props.js +24 -25
  114. package/components/u-swiper-indicator/props.js +5 -6
  115. package/components/u-switch/props.js +11 -12
  116. package/components/u-tabbar/props.js +8 -9
  117. package/components/u-tabbar-item/props.js +6 -7
  118. package/components/u-table/props.js +0 -1
  119. package/components/u-tabs/props.js +12 -13
  120. package/components/u-tabs-item/props.js +0 -1
  121. package/components/u-tag/props.js +15 -16
  122. package/components/u-td/props.js +0 -1
  123. package/components/u-text/props.js +21 -22
  124. package/components/u-textarea/props.js +23 -24
  125. package/components/u-toast/u-toast.vue +5 -0
  126. package/components/u-toolbar/props.js +6 -7
  127. package/components/u-tooltip/props.js +11 -12
  128. package/components/u-tooltip/u-tooltip.vue +0 -28
  129. package/components/u-tr/props.js +0 -1
  130. package/components/u-transition/props.js +4 -5
  131. package/components/u-transition/transition.js +8 -9
  132. package/components/u-transition/u-transition.vue +1 -1
  133. package/components/u-upload/props.js +22 -23
  134. package/components/u-upload/u-upload.vue +1 -1
  135. package/index.js +1 -5
  136. package/libs/config/props/actionSheet.js +1 -1
  137. package/libs/config/props/album.js +1 -1
  138. package/libs/config/props/avatarGroup.js +1 -1
  139. package/libs/config/props/backtop.js +2 -2
  140. package/libs/config/props/badge.js +1 -1
  141. package/libs/config/props/calendar.js +3 -3
  142. package/libs/config/props/checkboxGroup.js +1 -1
  143. package/libs/config/props/datetimePicker.js +1 -1
  144. package/libs/config/props/form.js +3 -3
  145. package/libs/config/props/formItem.js +1 -0
  146. package/libs/config/props/indexList.js +1 -1
  147. package/libs/config/props/noticeBar.js +1 -1
  148. package/libs/config/props/picker.js +2 -2
  149. package/libs/config/props/popup.js +1 -1
  150. package/libs/config/props/search.js +2 -2
  151. package/libs/config/props/slider.js +1 -1
  152. package/libs/config/props/swiper.js +1 -1
  153. package/libs/config/props/tabs.js +7 -7
  154. package/libs/config/props/text.js +2 -2
  155. package/libs/config/props/toast.js +1 -1
  156. package/libs/config/props/tooltip.js +1 -1
  157. package/libs/config/props/upload.js +3 -3
  158. package/libs/css/components.scss +11 -1
  159. package/libs/css/flex.scss +73 -71
  160. package/package.json +3 -2
@@ -1,90 +1,89 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
  // 图标类名
5
4
  name: {
6
5
  type: String,
7
- default: defprops.icon.name
6
+ default: () => uni.$u.props.icon.name
8
7
  },
9
8
  // 图标颜色,可接受主题色
10
9
  color: {
11
10
  type: String,
12
- default: defprops.icon.color
11
+ default: () => uni.$u.props.icon.color
13
12
  },
14
13
  // 字体大小,单位px
15
14
  size: {
16
15
  type: [String, Number],
17
- default: defprops.icon.size
16
+ default: () => uni.$u.props.icon.size
18
17
  },
19
18
  // 是否显示粗体
20
19
  bold: {
21
20
  type: Boolean,
22
- default: defprops.icon.bold
21
+ default: () => uni.$u.props.icon.bold
23
22
  },
24
23
  // 点击图标的时候传递事件出去的index(用于区分点击了哪一个)
25
24
  index: {
26
25
  type: [String, Number],
27
- default: defprops.icon.index
26
+ default: () => uni.$u.props.icon.index
28
27
  },
29
28
  // 触摸图标时的类名
30
29
  hoverClass: {
31
30
  type: String,
32
- default: defprops.icon.hoverClass
31
+ default: () => uni.$u.props.icon.hoverClass
33
32
  },
34
33
  // 自定义扩展前缀,方便用户扩展自己的图标库
35
34
  customPrefix: {
36
35
  type: String,
37
- default: defprops.icon.customPrefix
36
+ default: () => uni.$u.props.icon.customPrefix
38
37
  },
39
38
  // 图标右边或者下面的文字
40
39
  label: {
41
40
  type: [String, Number],
42
- default: defprops.icon.label
41
+ default: () => uni.$u.props.icon.label
43
42
  },
44
43
  // label的位置,只能右边或者下边
45
44
  labelPos: {
46
45
  type: String,
47
- default: defprops.icon.labelPos
46
+ default: () => uni.$u.props.icon.labelPos
48
47
  },
49
48
  // label的大小
50
49
  labelSize: {
51
50
  type: [String, Number],
52
- default: defprops.icon.labelSize
51
+ default: () => uni.$u.props.icon.labelSize
53
52
  },
54
53
  // label的颜色
55
54
  labelColor: {
56
55
  type: String,
57
- default: defprops.icon.labelColor
56
+ default: () => uni.$u.props.icon.labelColor
58
57
  },
59
58
  // label与图标的距离
60
59
  space: {
61
60
  type: [String, Number],
62
- default: defprops.icon.space
61
+ default: () => uni.$u.props.icon.space
63
62
  },
64
63
  // 图片的mode
65
64
  imgMode: {
66
65
  type: String,
67
- default: defprops.icon.imgMode
66
+ default: () => uni.$u.props.icon.imgMode
68
67
  },
69
68
  // 用于显示图片小图标时,图片的宽度
70
69
  width: {
71
70
  type: [String, Number],
72
- default: defprops.icon.width
71
+ default: () => uni.$u.props.icon.width
73
72
  },
74
73
  // 用于显示图片小图标时,图片的高度
75
74
  height: {
76
75
  type: [String, Number],
77
- default: defprops.icon.height
76
+ default: () => uni.$u.props.icon.height
78
77
  },
79
78
  // 用于解决某些情况下,让图标垂直居中的用途
80
79
  top: {
81
80
  type: [String, Number],
82
- default: defprops.icon.top
81
+ default: () => uni.$u.props.icon.top
83
82
  },
84
83
  // 是否阻止事件传播
85
84
  stop: {
86
85
  type: Boolean,
87
- default: defprops.icon.stop
86
+ default: () => uni.$u.props.icon.stop
88
87
  }
89
88
  }
90
89
  }
@@ -92,12 +92,13 @@
92
92
  uClasses() {
93
93
  let classes = []
94
94
  classes.push(this.customPrefix + '-' + this.name)
95
- // // uView的自定义图标类名为u-iconfont
96
- // if (this.customPrefix == 'uicon') {
97
- // classes.push('u-iconfont')
98
- // } else {
99
- // classes.push(this.customPrefix)
100
- // }
95
+ // uView的自定义图标类名为u-iconfont
96
+ if (this.customPrefix == 'uicon') {
97
+ classes.push('u-iconfont')
98
+ } else {
99
+ // 不能缺少这一步,否则自定义图标会无效
100
+ classes.push(this.customPrefix)
101
+ }
101
102
  // 主题色,通过类配置
102
103
  if (this.color && uni.$u.config.type.includes(this.color)) classes.push('u-icon__icon--' + this.color)
103
104
  // 阿里,头条,百度小程序通过数组绑定类名时,无法直接使用[a, b, c]的形式,否则无法识别
@@ -134,6 +135,8 @@
134
135
  },
135
136
  // 通过图标名,查找对应的图标
136
137
  icon() {
138
+ // 使用自定义图标的时候页面上会把name属性也展示出来,所以在这里处理一下
139
+ if (this.customPrefix !== "uicon") return "";
137
140
  // 如果内置的图标中找不到对应的图标,就直接返回name值,因为用户可能传入的是unicode代码
138
141
  return icons['uicon-' + this.name] || this.name
139
142
  }
@@ -1,85 +1,84 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
  // 图片地址
5
4
  src: {
6
5
  type: String,
7
- default: defprops.image.src
6
+ default: () => uni.$u.props.image.src
8
7
  },
9
8
  // 裁剪模式
10
9
  mode: {
11
10
  type: String,
12
- default: defprops.image.mode
11
+ default: () => uni.$u.props.image.mode
13
12
  },
14
13
  // 宽度,单位任意
15
14
  width: {
16
15
  type: [String, Number],
17
- default: defprops.image.width
16
+ default: () => uni.$u.props.image.width
18
17
  },
19
18
  // 高度,单位任意
20
19
  height: {
21
20
  type: [String, Number],
22
- default: defprops.image.height
21
+ default: () => uni.$u.props.image.height
23
22
  },
24
23
  // 图片形状,circle-圆形,square-方形
25
24
  shape: {
26
25
  type: String,
27
- default: defprops.image.shape
26
+ default: () => uni.$u.props.image.shape
28
27
  },
29
28
  // 圆角,单位任意
30
29
  radius: {
31
30
  type: [String, Number],
32
- default: defprops.image.radius
31
+ default: () => uni.$u.props.image.radius
33
32
  },
34
33
  // 是否懒加载,微信小程序、App、百度小程序、字节跳动小程序
35
34
  lazyLoad: {
36
35
  type: Boolean,
37
- default: defprops.image.lazyLoad
36
+ default: () => uni.$u.props.image.lazyLoad
38
37
  },
39
38
  // 开启长按图片显示识别微信小程序码菜单
40
39
  showMenuByLongpress: {
41
40
  type: Boolean,
42
- default: defprops.image.showMenuByLongpress
41
+ default: () => uni.$u.props.image.showMenuByLongpress
43
42
  },
44
43
  // 加载中的图标,或者小图片
45
44
  loadingIcon: {
46
45
  type: String,
47
- default: defprops.image.loadingIcon
46
+ default: () => uni.$u.props.image.loadingIcon
48
47
  },
49
48
  // 加载失败的图标,或者小图片
50
49
  errorIcon: {
51
50
  type: String,
52
- default: defprops.image.errorIcon
51
+ default: () => uni.$u.props.image.errorIcon
53
52
  },
54
53
  // 是否显示加载中的图标或者自定义的slot
55
54
  showLoading: {
56
55
  type: Boolean,
57
- default: defprops.image.showLoading
56
+ default: () => uni.$u.props.image.showLoading
58
57
  },
59
58
  // 是否显示加载错误的图标或者自定义的slot
60
59
  showError: {
61
60
  type: Boolean,
62
- default: defprops.image.showError
61
+ default: () => uni.$u.props.image.showError
63
62
  },
64
63
  // 是否需要淡入效果
65
64
  fade: {
66
65
  type: Boolean,
67
- default: defprops.image.fade
66
+ default: () => uni.$u.props.image.fade
68
67
  },
69
68
  // 只支持网络资源,只对微信小程序有效
70
69
  webp: {
71
70
  type: Boolean,
72
- default: defprops.image.webp
71
+ default: () => uni.$u.props.image.webp
73
72
  },
74
73
  // 过渡时间,单位ms
75
74
  duration: {
76
75
  type: [String, Number],
77
- default: defprops.image.duration
76
+ default: () => uni.$u.props.image.duration
78
77
  },
79
78
  // 背景颜色,用于深色页面加载图片时,为了和背景色融合
80
79
  bgColor: {
81
80
  type: String,
82
- default: defprops.image.bgColor
81
+ default: () => uni.$u.props.image.bgColor
83
82
  }
84
83
  }
85
84
  }
@@ -70,7 +70,7 @@
70
70
  /**
71
71
  * Image 图片
72
72
  * @description 此组件为uni-app的image组件的加强版,在继承了原有功能外,还支持淡入动画、加载中、加载失败提示、圆角值和形状等。
73
- * @tutorial https://uiadmin.net/uview-plus/components/image.html
73
+ * @tutorial https://uview-plus.jiangruyi.com/components/image.html
74
74
  * @property {String} src 图片地址
75
75
  * @property {String} mode 裁剪模式,见官网说明 (默认 'aspectFill' )
76
76
  * @property {String | Number} width 宽度,单位任意,如果为数值,则为px单位 (默认 '300' )
@@ -1,30 +1,29 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
  // 列表锚点文本内容
5
4
  text: {
6
5
  type: [String, Number],
7
- default: defprops.indexAnchor.text
6
+ default: () => uni.$u.props.indexAnchor.text
8
7
  },
9
8
  // 列表锚点文字颜色
10
9
  color: {
11
10
  type: String,
12
- default: defprops.indexAnchor.color
11
+ default: () => uni.$u.props.indexAnchor.color
13
12
  },
14
13
  // 列表锚点文字大小,单位默认px
15
14
  size: {
16
15
  type: [String, Number],
17
- default: defprops.indexAnchor.size
16
+ default: () => uni.$u.props.indexAnchor.size
18
17
  },
19
18
  // 列表锚点背景颜色
20
19
  bgColor: {
21
20
  type: String,
22
- default: defprops.indexAnchor.bgColor
21
+ default: () => uni.$u.props.indexAnchor.bgColor
23
22
  },
24
23
  // 列表锚点高度,单位默认px
25
24
  height: {
26
25
  type: [String, Number],
27
- default: defprops.indexAnchor.height
26
+ default: () => uni.$u.props.indexAnchor.height
28
27
  }
29
28
  }
30
29
  }
@@ -33,7 +33,7 @@
33
33
  /**
34
34
  * IndexAnchor 列表锚点
35
35
  * @description
36
- * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
36
+ * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
37
37
  * @property {String | Number} text 列表锚点文本内容
38
38
  * @property {String} color 列表锚点文字颜色 ( 默认 '#606266' )
39
39
  * @property {String | Number} size 列表锚点文字大小,单位默认px ( 默认 14 )
@@ -1,4 +1,3 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
 
@@ -25,7 +25,7 @@
25
25
  /**
26
26
  * IndexItem
27
27
  * @description
28
- * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
28
+ * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
29
29
  * @property {String}
30
30
  * @event {Function}
31
31
  * @example
@@ -1,30 +1,29 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
  // 右边锚点非激活的颜色
5
4
  inactiveColor: {
6
5
  type: String,
7
- default: defprops.indexList.inactiveColor
6
+ default: () => uni.$u.props.indexList.inactiveColor
8
7
  },
9
8
  // 右边锚点激活的颜色
10
9
  activeColor: {
11
10
  type: String,
12
- default: defprops.indexList.activeColor
11
+ default: () => uni.$u.props.indexList.activeColor
13
12
  },
14
13
  // 索引字符列表,数组形式
15
14
  indexList: {
16
15
  type: Array,
17
- default: defprops.indexList.indexList
16
+ default: () => uni.$u.props.indexList.indexList
18
17
  },
19
18
  // 是否开启锚点自动吸顶
20
19
  sticky: {
21
20
  type: Boolean,
22
- default: defprops.indexList.sticky
21
+ default: () => uni.$u.props.indexList.sticky
23
22
  },
24
23
  // 自定义导航栏的高度
25
24
  customNavHeight: {
26
25
  type: [String, Number],
27
- default: defprops.indexList.customNavHeight
26
+ default: () => uni.$u.props.indexList.customNavHeight
28
27
  }
29
28
  }
30
29
  }
@@ -110,7 +110,7 @@
110
110
  /**
111
111
  * IndexList 索引列表
112
112
  * @description 通过折叠面板收纳内容区域
113
- * @tutorial https://uiadmin.net/uview-plus/components/indexList.html
113
+ * @tutorial https://uview-plus.jiangruyi.com/components/indexList.html
114
114
  * @property {String} inactiveColor 右边锚点非激活的颜色 ( 默认 '#606266' )
115
115
  * @property {String} activeColor 右边锚点激活的颜色 ( 默认 '#5677fc' )
116
116
  * @property {Array} indexList 索引字符列表,数组形式
@@ -310,7 +310,8 @@
310
310
  // #endif
311
311
  // #ifdef MP-WEIXIN
312
312
  // 微信小程序下,scroll-view的scroll-into-view属性无法对slot中的内容的id生效,只能通过设置scrollTop的形式去移动滚动条
313
- this.scrollTop = this.children[currentIndex].top
313
+ const customNavHeight = this.customNavHeight
314
+ this.scrollTop = this.children[currentIndex].top - uni.$u.getPx(customNavHeight)
314
315
  // #endif
315
316
  // #ifdef APP-NVUE
316
317
  // 在nvue中,由于cell和header为同级元素,所以实际是需要对header(anchor)进行偏移
@@ -1,18 +1,17 @@
1
- import defprops from '../../libs/config/props';
2
1
  export default {
3
2
  props: {
4
3
  // #ifdef VUE3
5
4
  // 绑定的值
6
5
  modelValue: {
7
6
  type: [String, Number],
8
- default: defprops.input.value
7
+ default: () => uni.$u.props.input.value
9
8
  },
10
9
  // #endif
11
10
  // #ifdef VUE2
12
11
  // 绑定的值
13
12
  value: {
14
13
  type: [String, Number],
15
- default: defprops.input.value
14
+ default: () => uni.$u.props.input.value
16
15
  },
17
16
  // #endif
18
17
  // number-数字输入键盘,app-vue下可以输入浮点数,app-nvue和小程序平台下只能输入整数
@@ -21,171 +20,171 @@ export default {
21
20
  // text-文本输入键盘
22
21
  type: {
23
22
  type: String,
24
- default: defprops.input.type
23
+ default: () => uni.$u.props.input.type
25
24
  },
26
25
  // 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,
27
26
  // 兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序
28
27
  fixed: {
29
28
  type: Boolean,
30
- default: defprops.input.fixed
29
+ default: () => uni.$u.props.input.fixed
31
30
  },
32
31
  // 是否禁用输入框
33
32
  disabled: {
34
33
  type: Boolean,
35
- default: defprops.input.disabled
34
+ default: () => uni.$u.props.input.disabled
36
35
  },
37
36
  // 禁用状态时的背景色
38
37
  disabledColor: {
39
38
  type: String,
40
- default: defprops.input.disabledColor
39
+ default: () => uni.$u.props.input.disabledColor
41
40
  },
42
41
  // 是否显示清除控件
43
42
  clearable: {
44
43
  type: Boolean,
45
- default: defprops.input.clearable
44
+ default: () => uni.$u.props.input.clearable
46
45
  },
47
46
  // 是否密码类型
48
47
  password: {
49
48
  type: Boolean,
50
- default: defprops.input.password
49
+ default: () => uni.$u.props.input.password
51
50
  },
52
51
  // 最大输入长度,设置为 -1 的时候不限制最大长度
53
52
  maxlength: {
54
53
  type: [String, Number],
55
- default: defprops.input.maxlength
54
+ default: () => uni.$u.props.input.maxlength
56
55
  },
57
56
  // 输入框为空时的占位符
58
57
  placeholder: {
59
58
  type: String,
60
- default: defprops.input.placeholder
59
+ default: () => uni.$u.props.input.placeholder
61
60
  },
62
61
  // 指定placeholder的样式类,注意页面或组件的style中写了scoped时,需要在类名前写/deep/
63
62
  placeholderClass: {
64
63
  type: String,
65
- default: defprops.input.placeholderClass
64
+ default: () => uni.$u.props.input.placeholderClass
66
65
  },
67
66
  // 指定placeholder的样式
68
67
  placeholderStyle: {
69
68
  type: [String, Object],
70
- default: defprops.input.placeholderStyle
69
+ default: () => uni.$u.props.input.placeholderStyle
71
70
  },
72
71
  // 是否显示输入字数统计,只在 type ="text"或type ="textarea"时有效
73
72
  showWordLimit: {
74
73
  type: Boolean,
75
- default: defprops.input.showWordLimit
74
+ default: () => uni.$u.props.input.showWordLimit
76
75
  },
77
76
  // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
78
77
  // https://uniapp.dcloud.io/component/input
79
78
  // https://uniapp.dcloud.io/component/textarea
80
79
  confirmType: {
81
80
  type: String,
82
- default: defprops.input.confirmType
81
+ default: () => uni.$u.props.input.confirmType
83
82
  },
84
83
  // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
85
84
  confirmHold: {
86
85
  type: Boolean,
87
- default: defprops.input.confirmHold
86
+ default: () => uni.$u.props.input.confirmHold
88
87
  },
89
88
  // focus时,点击页面的时候不收起键盘,微信小程序有效
90
89
  holdKeyboard: {
91
90
  type: Boolean,
92
- default: defprops.input.holdKeyboard
91
+ default: () => uni.$u.props.input.holdKeyboard
93
92
  },
94
93
  // 自动获取焦点
95
94
  // 在 H5 平台能否聚焦以及软键盘是否跟随弹出,取决于当前浏览器本身的实现。nvue 页面不支持,需使用组件的 focus()、blur() 方法控制焦点
96
95
  focus: {
97
96
  type: Boolean,
98
- default: defprops.input.focus
97
+ default: () => uni.$u.props.input.focus
99
98
  },
100
99
  // 键盘收起时,是否自动失去焦点,目前仅App3.0.0+有效
101
100
  autoBlur: {
102
101
  type: Boolean,
103
- default: defprops.input.autoBlur
102
+ default: () => uni.$u.props.input.autoBlur
104
103
  },
105
104
  // 是否去掉 iOS 下的默认内边距,仅微信小程序,且type=textarea时有效
106
105
  disableDefaultPadding: {
107
106
  type: Boolean,
108
- default: defprops.input.disableDefaultPadding
107
+ default: () => uni.$u.props.input.disableDefaultPadding
109
108
  },
110
109
  // 指定focus时光标的位置
111
110
  cursor: {
112
111
  type: [String, Number],
113
- default: defprops.input.cursor
112
+ default: () => uni.$u.props.input.cursor
114
113
  },
115
114
  // 输入框聚焦时底部与键盘的距离
116
115
  cursorSpacing: {
117
116
  type: [String, Number],
118
- default: defprops.input.cursorSpacing
117
+ default: () => uni.$u.props.input.cursorSpacing
119
118
  },
120
119
  // 光标起始位置,自动聚集时有效,需与selection-end搭配使用
121
120
  selectionStart: {
122
121
  type: [String, Number],
123
- default: defprops.input.selectionStart
122
+ default: () => uni.$u.props.input.selectionStart
124
123
  },
125
124
  // 光标结束位置,自动聚集时有效,需与selection-start搭配使用
126
125
  selectionEnd: {
127
126
  type: [String, Number],
128
- default: defprops.input.selectionEnd
127
+ default: () => uni.$u.props.input.selectionEnd
129
128
  },
130
129
  // 键盘弹起时,是否自动上推页面
131
130
  adjustPosition: {
132
131
  type: Boolean,
133
- default: defprops.input.adjustPosition
132
+ default: () => uni.$u.props.input.adjustPosition
134
133
  },
135
134
  // 输入框内容对齐方式,可选值为:left|center|right
136
135
  inputAlign: {
137
136
  type: String,
138
- default: defprops.input.inputAlign
137
+ default: () => uni.$u.props.input.inputAlign
139
138
  },
140
139
  // 输入框字体的大小
141
140
  fontSize: {
142
141
  type: [String, Number],
143
- default: defprops.input.fontSize
142
+ default: () => uni.$u.props.input.fontSize
144
143
  },
145
144
  // 输入框字体颜色
146
145
  color: {
147
146
  type: String,
148
- default: defprops.input.color
147
+ default: () => uni.$u.props.input.color
149
148
  },
150
149
  // 输入框前置图标
151
150
  prefixIcon: {
152
151
  type: String,
153
- default: defprops.input.prefixIcon
152
+ default: () => uni.$u.props.input.prefixIcon
154
153
  },
155
154
  // 前置图标样式,对象或字符串
156
155
  prefixIconStyle: {
157
156
  type: [String, Object],
158
- default: defprops.input.prefixIconStyle
157
+ default: () => uni.$u.props.input.prefixIconStyle
159
158
  },
160
159
  // 输入框后置图标
161
160
  suffixIcon: {
162
161
  type: String,
163
- default: defprops.input.suffixIcon
162
+ default: () => uni.$u.props.input.suffixIcon
164
163
  },
165
164
  // 后置图标样式,对象或字符串
166
165
  suffixIconStyle: {
167
166
  type: [String, Object],
168
- default: defprops.input.suffixIconStyle
167
+ default: () => uni.$u.props.input.suffixIconStyle
169
168
  },
170
169
  // 边框类型,surround-四周边框,bottom-底部边框,none-无边框
171
170
  border: {
172
171
  type: String,
173
- default: defprops.input.border
172
+ default: () => uni.$u.props.input.border
174
173
  },
175
174
  // 是否只读,与disabled不同之处在于disabled会置灰组件,而readonly则不会
176
175
  readonly: {
177
176
  type: Boolean,
178
- default: defprops.input.readonly
177
+ default: () => uni.$u.props.input.readonly
179
178
  },
180
179
  // 输入框形状,circle-圆形,square-方形
181
180
  shape: {
182
181
  type: String,
183
- default: defprops.input.shape
182
+ default: () => uni.$u.props.input.shape
184
183
  },
185
184
  // 用于处理或者过滤输入框内容的方法
186
185
  formatter: {
187
186
  type: [Function, null],
188
- default: defprops.input.formatter
187
+ default: () => uni.$u.props.input.formatter
189
188
  },
190
189
  // 是否忽略组件内对文本合成系统事件的处理
191
190
  ignoreCompositionEvent: {
@@ -82,7 +82,7 @@ import mixin from '../../libs/mixin/mixin.js';
82
82
  /**
83
83
  * Input 输入框
84
84
  * @description 此组件为一个输入框,默认没有边框和样式,是专门为配合表单组件u-form而设计的,利用它可以快速实现表单验证,输入内容,下拉选择等功能。
85
- * @tutorial https://uiadmin.net/uview-plus/components/input.html
85
+ * @tutorial https://uview-plus.jiangruyi.com/components/input.html
86
86
  * @property {String | Number} value 输入的值
87
87
  * @property {String} type 输入框类型,见上方说明 ( 默认 'text' )
88
88
  * @property {Boolean} fixed 如果 textarea 是在一个 position:fixed 的区域,需要显示指定属性 fixed 为 true,兼容性:微信小程序、百度小程序、字节跳动小程序、QQ小程序 ( 默认 false )
@@ -148,10 +148,13 @@ export default {
148
148
  // 在H5中,外部value变化后,修改input中的值,不会触发@input事件,此时手动调用值变化方法
149
149
  if (
150
150
  this.firstChange === false &&
151
- this.changeFromInner === false
151
+ this.changeFromInner === false
152
152
  ) {
153
153
  this.valueChange();
154
- } else {
154
+ } else {
155
+ // 尝试调用u-form的验证方法
156
+ uni.$u.formValidate(this, "change");
157
+ }
155
158
  /* #endif */
156
159
  this.firstChange = false;
157
160
  // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的
@@ -171,7 +174,10 @@ export default {
171
174
  this.changeFromInner === false
172
175
  ) {
173
176
  this.valueChange();
174
- } else {
177
+ } else {
178
+ // 尝试调用u-form的验证方法
179
+ uni.$u.formValidate(this, "change");
180
+ }
175
181
  /* #endif */
176
182
  this.firstChange = false;
177
183
  // 重置changeFromInner的值为false,标识下一次引起默认为外部引起的