uview-plus 3.1.49 → 3.1.50

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