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,143 +1,131 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
- // 是否显示input
4
- hasInput: {
5
- type: Boolean,
6
- default: () => false
7
- },
8
- placeholder: {
9
- type: String,
10
- default: () => '请选择'
11
- },
12
- format: {
13
- type: String,
14
- default: () => 'YYYY-MM-DD HH:mm'
15
- },
16
4
  // 是否打开组件
17
5
  show: {
18
6
  type: Boolean,
19
- default: () => uni.$u.props.datetimePicker.show
7
+ default: defprops.datetimePicker.show
20
8
  },
21
9
  // 弹出的方向,可选值为 top bottom right left center
22
10
  popupMode: {
23
11
  type: String,
24
- default: () => uni.$u.props.picker.popupMode
12
+ default: defprops.picker.popupMode
25
13
  },
26
14
  // 是否展示顶部的操作栏
27
15
  showToolbar: {
28
16
  type: Boolean,
29
- default: () => uni.$u.props.datetimePicker.showToolbar
17
+ default: defprops.datetimePicker.showToolbar
30
18
  },
31
19
  // #ifdef VUE2
32
20
  // 绑定值
33
21
  value: {
34
22
  type: [String, Number],
35
- default: () => uni.$u.props.datetimePicker.value
23
+ default: defprops.datetimePicker.value
36
24
  },
37
25
  // #endif
38
26
  // #ifdef VUE3
39
27
  // 绑定值
40
28
  modelValue: {
41
29
  type: [String, Number],
42
- default: () => uni.$u.props.datetimePicker.value
30
+ default: defprops.datetimePicker.value
43
31
  },
44
32
  // #endif
45
33
  // 顶部标题
46
34
  title: {
47
35
  type: String,
48
- default: () => uni.$u.props.datetimePicker.title
36
+ default: defprops.datetimePicker.title
49
37
  },
50
38
  // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
51
39
  mode: {
52
40
  type: String,
53
- default: () => uni.$u.props.datetimePicker.mode
41
+ default: defprops.datetimePicker.mode
54
42
  },
55
43
  // 可选的最大时间
56
44
  maxDate: {
57
45
  type: Number,
58
46
  // 最大默认值为后10年
59
- default: () => uni.$u.props.datetimePicker.maxDate
47
+ default: defprops.datetimePicker.maxDate
60
48
  },
61
49
  // 可选的最小时间
62
50
  minDate: {
63
51
  type: Number,
64
52
  // 最小默认值为前10年
65
- default: () => uni.$u.props.datetimePicker.minDate
53
+ default: defprops.datetimePicker.minDate
66
54
  },
67
55
  // 可选的最小小时,仅mode=time有效
68
56
  minHour: {
69
57
  type: Number,
70
- default: () => uni.$u.props.datetimePicker.minHour
58
+ default: defprops.datetimePicker.minHour
71
59
  },
72
60
  // 可选的最大小时,仅mode=time有效
73
61
  maxHour: {
74
62
  type: Number,
75
- default: () => uni.$u.props.datetimePicker.maxHour
63
+ default: defprops.datetimePicker.maxHour
76
64
  },
77
65
  // 可选的最小分钟,仅mode=time有效
78
66
  minMinute: {
79
67
  type: Number,
80
- default: () => uni.$u.props.datetimePicker.minMinute
68
+ default: defprops.datetimePicker.minMinute
81
69
  },
82
70
  // 可选的最大分钟,仅mode=time有效
83
71
  maxMinute: {
84
72
  type: Number,
85
- default: () => uni.$u.props.datetimePicker.maxMinute
73
+ default: defprops.datetimePicker.maxMinute
86
74
  },
87
75
  // 选项过滤函数
88
76
  filter: {
89
77
  type: [Function, null],
90
- default: () => uni.$u.props.datetimePicker.filter
78
+ default: defprops.datetimePicker.filter
91
79
  },
92
80
  // 选项格式化函数
93
81
  formatter: {
94
82
  type: [Function, null],
95
- default: () => uni.$u.props.datetimePicker.formatter
83
+ default: defprops.datetimePicker.formatter
96
84
  },
97
85
  // 是否显示加载中状态
98
86
  loading: {
99
87
  type: Boolean,
100
- default: () => uni.$u.props.datetimePicker.loading
88
+ default: defprops.datetimePicker.loading
101
89
  },
102
90
  // 各列中,单个选项的高度
103
91
  itemHeight: {
104
92
  type: [String, Number],
105
- default: () => uni.$u.props.datetimePicker.itemHeight
93
+ default: defprops.datetimePicker.itemHeight
106
94
  },
107
95
  // 取消按钮的文字
108
96
  cancelText: {
109
97
  type: String,
110
- default: () => uni.$u.props.datetimePicker.cancelText
98
+ default: defprops.datetimePicker.cancelText
111
99
  },
112
100
  // 确认按钮的文字
113
101
  confirmText: {
114
102
  type: String,
115
- default: () => uni.$u.props.datetimePicker.confirmText
103
+ default: defprops.datetimePicker.confirmText
116
104
  },
117
105
  // 取消按钮的颜色
118
106
  cancelColor: {
119
107
  type: String,
120
- default: () => uni.$u.props.datetimePicker.cancelColor
108
+ default: defprops.datetimePicker.cancelColor
121
109
  },
122
110
  // 确认按钮的颜色
123
111
  confirmColor: {
124
112
  type: String,
125
- default: () => uni.$u.props.datetimePicker.confirmColor
113
+ default: defprops.datetimePicker.confirmColor
126
114
  },
127
115
  // 每列中可见选项的数量
128
116
  visibleItemCount: {
129
117
  type: [String, Number],
130
- default: () => uni.$u.props.datetimePicker.visibleItemCount
118
+ default: defprops.datetimePicker.visibleItemCount
131
119
  },
132
120
  // 是否允许点击遮罩关闭选择器
133
121
  closeOnClickOverlay: {
134
122
  type: Boolean,
135
- default: () => uni.$u.props.datetimePicker.closeOnClickOverlay
123
+ default: defprops.datetimePicker.closeOnClickOverlay
136
124
  },
137
125
  // 各列的默认索引
138
126
  defaultIndex: {
139
127
  type: Array,
140
- default: () => uni.$u.props.datetimePicker.defaultIndex
128
+ default: defprops.datetimePicker.defaultIndex
141
129
  }
142
130
  }
143
131
  }
@@ -1,15 +1,7 @@
1
1
  <template>
2
- <view v-if="hasInput">
3
- <u-input
4
- :placeholder="placeholder"
5
- border="surround"
6
- v-model="inputValue"
7
- @click="showByClickInput = !showByClickInput"
8
- ></u-input>
9
- </view>
10
2
  <u-picker
11
3
  ref="picker"
12
- :show="show || (hasInput && showByClickInput)"
4
+ :show="show"
13
5
  :popupMode="popupMode"
14
6
  :closeOnClickOverlay="closeOnClickOverlay"
15
7
  :columns="columns"
@@ -51,7 +43,7 @@
51
43
  * @tutorial https://ijry.github.io/uview-plus/components/datetimePicker.html
52
44
  * @property {Boolean} show 用于控制选择器的弹出与收起 ( 默认 false )
53
45
  * @property {Boolean} showToolbar 是否显示顶部的操作栏 ( 默认 true )
54
- * @property {String | Number} modelValue 绑定值
46
+ * @property {String | Number} value 绑定值
55
47
  * @property {String} title 顶部标题
56
48
  * @property {String} mode 展示格式 mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择 ( 默认 ‘datetime )
57
49
  * @property {Number} maxDate 可选的最大时间 默认值为后10年
@@ -82,9 +74,6 @@
82
74
  mixins: [mpMixin, mixin, props],
83
75
  data() {
84
76
  return {
85
- // 原来的日期选择器不方便,这里增加一个hasInput选项支持类似element的自带输入框的功能。
86
- inputValue: '', // 表单显示值
87
- showByClickInput: false, // 是否在hasInput模式下显示日期选择弹唱
88
77
  columns: [],
89
78
  innerDefaultIndex: [],
90
79
  innerFormatter: (type, value) => value
@@ -99,7 +88,6 @@
99
88
  // #ifdef VUE3
100
89
  modelValue(newValue) {
101
90
  this.init()
102
- this.inputValue = dayjs(newValue).format(this.format || 'YYYY-MM-DD HH:mm')
103
91
  },
104
92
  // #endif
105
93
  // #ifdef VUE2
@@ -145,9 +133,6 @@
145
133
  },
146
134
  // 点击工具栏的取消按钮
147
135
  cancel() {
148
- if (this.hasInput) {
149
- this.showByClickInput = false
150
- }
151
136
  this.$emit('cancel')
152
137
  },
153
138
  // 点击工具栏的确定按钮
@@ -156,16 +141,12 @@
156
141
  value: this.innerValue,
157
142
  mode: this.mode
158
143
  })
159
- this.inputValue = dayjs(this.innerValue).format(this.format || 'YYYY-MM-DD HH:mm')
160
144
  // #ifdef VUE3
161
145
  this.$emit('update:modelValue', this.innerValue)
162
146
  // #endif
163
147
  // #ifdef VUE2
164
148
  this.$emit('input', this.innerValue)
165
149
  // #endif
166
- if (this.hasInput) {
167
- this.showByClickInput = false
168
- }
169
150
  },
170
151
  //用正则截取输出值,当出现多组数字时,抛出错误
171
152
  intercept(e,type){
@@ -233,7 +214,7 @@
233
214
  setTimeout(() => {
234
215
  this.updateIndexs(value)
235
216
  }, 0);
236
-
217
+
237
218
  },
238
219
  // 更新索引
239
220
  updateIndexs(value) {
@@ -1,44 +1,45 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 是否虚线
4
5
  dashed: {
5
6
  type: Boolean,
6
- default: () => uni.$u.props.divider.dashed
7
+ default: defprops.divider.dashed
7
8
  },
8
9
  // 是否细线
9
10
  hairline: {
10
11
  type: Boolean,
11
- default: () => uni.$u.props.divider.hairline
12
+ default: defprops.divider.hairline
12
13
  },
13
14
  // 是否以点替代文字,优先于text字段起作用
14
15
  dot: {
15
16
  type: Boolean,
16
- default: () => uni.$u.props.divider.dot
17
+ default: defprops.divider.dot
17
18
  },
18
19
  // 内容文本的位置,left-左边,center-中间,right-右边
19
20
  textPosition: {
20
21
  type: String,
21
- default: () => uni.$u.props.divider.textPosition
22
+ default: defprops.divider.textPosition
22
23
  },
23
24
  // 文本内容
24
25
  text: {
25
26
  type: [String, Number],
26
- default: () => uni.$u.props.divider.text
27
+ default: defprops.divider.text
27
28
  },
28
29
  // 文本大小
29
30
  textSize: {
30
31
  type: [String, Number],
31
- default: () => uni.$u.props.divider.textSize
32
+ default: defprops.divider.textSize
32
33
  },
33
34
  // 文本颜色
34
35
  textColor: {
35
36
  type: String,
36
- default: () => uni.$u.props.divider.textColor
37
+ default: defprops.divider.textColor
37
38
  },
38
39
  // 线条颜色
39
40
  lineColor: {
40
41
  type: String,
41
- default: () => uni.$u.props.divider.lineColor
42
+ default: defprops.divider.lineColor
42
43
  }
43
44
  }
44
45
  }
@@ -1,3 +1,4 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 标题选中时的样式
@@ -1,3 +1,4 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 当前选中项的value值
@@ -1,59 +1,60 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 内置图标名称,或图片路径,建议绝对路径
4
5
  icon: {
5
6
  type: String,
6
- default: () => uni.$u.props.empty.icon
7
+ default: defprops.empty.icon
7
8
  },
8
9
  // 提示文字
9
10
  text: {
10
11
  type: String,
11
- default: () => uni.$u.props.empty.text
12
+ default: defprops.empty.text
12
13
  },
13
14
  // 文字颜色
14
15
  textColor: {
15
16
  type: String,
16
- default: () => uni.$u.props.empty.textColor
17
+ default: defprops.empty.textColor
17
18
  },
18
19
  // 文字大小
19
20
  textSize: {
20
21
  type: [String, Number],
21
- default: () => uni.$u.props.empty.textSize
22
+ default: defprops.empty.textSize
22
23
  },
23
24
  // 图标的颜色
24
25
  iconColor: {
25
26
  type: String,
26
- default: () => uni.$u.props.empty.iconColor
27
+ default: defprops.empty.iconColor
27
28
  },
28
29
  // 图标的大小
29
30
  iconSize: {
30
31
  type: [String, Number],
31
- default: () => uni.$u.props.empty.iconSize
32
+ default: defprops.empty.iconSize
32
33
  },
33
34
  // 选择预置的图标类型
34
35
  mode: {
35
36
  type: String,
36
- default: () => uni.$u.props.empty.mode
37
+ default: defprops.empty.mode
37
38
  },
38
39
  // 图标宽度,单位px
39
40
  width: {
40
41
  type: [String, Number],
41
- default: () => uni.$u.props.empty.width
42
+ default: defprops.empty.width
42
43
  },
43
44
  // 图标高度,单位px
44
45
  height: {
45
46
  type: [String, Number],
46
- default: () => uni.$u.props.empty.height
47
+ default: defprops.empty.height
47
48
  },
48
49
  // 是否显示组件
49
50
  show: {
50
51
  type: Boolean,
51
- default: () => uni.$u.props.empty.show
52
+ default: defprops.empty.show
52
53
  },
53
54
  // 组件距离上一个元素之间的距离,默认px单位
54
55
  marginTop: {
55
56
  type: [String, Number],
56
- default: () => uni.$u.props.empty.marginTop
57
+ default: defprops.empty.marginTop
57
58
  }
58
59
  }
59
60
  }
@@ -1,45 +1,46 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 当前form的需要验证字段的集合
4
5
  model: {
5
6
  type: Object,
6
- default: () => uni.$u.props.form.model
7
+ default: defprops.form.model
7
8
  },
8
9
  // 验证规则
9
10
  rules: {
10
11
  type: [Object, Function, Array],
11
- default: () => uni.$u.props.form.rules
12
+ default: defprops.form.rules
12
13
  },
13
14
  // 有错误时的提示方式,message-提示信息,toast-进行toast提示
14
15
  // border-bottom-下边框呈现红色,none-无提示
15
16
  errorType: {
16
17
  type: String,
17
- default: () => uni.$u.props.form.errorType
18
+ default: defprops.form.errorType
18
19
  },
19
20
  // 是否显示表单域的下划线边框
20
21
  borderBottom: {
21
22
  type: Boolean,
22
- default: () => uni.$u.props.form.borderBottom
23
+ default: defprops.form.borderBottom
23
24
  },
24
25
  // label的位置,left-左边,top-上边
25
26
  labelPosition: {
26
27
  type: String,
27
- default: () => uni.$u.props.form.labelPosition
28
+ default: defprops.form.labelPosition
28
29
  },
29
30
  // label的宽度,单位px
30
31
  labelWidth: {
31
32
  type: [String, Number],
32
- default: () => uni.$u.props.form.labelWidth
33
+ default: defprops.form.labelWidth
33
34
  },
34
35
  // lable字体的对齐方式
35
36
  labelAlign: {
36
37
  type: String,
37
- default: () => uni.$u.props.form.labelAlign
38
+ default: defprops.form.labelAlign
38
39
  },
39
40
  // lable的样式,对象形式
40
41
  labelStyle: {
41
42
  type: Object,
42
- default: () => uni.$u.props.form.labelStyle
43
+ default: defprops.form.labelStyle
43
44
  }
44
45
  }
45
46
  }
@@ -146,7 +146,7 @@
146
146
  const propertyName =
147
147
  propertyChain[propertyChain.length - 1];
148
148
 
149
- const rule = this.formRules[child.rule || child.prop];
149
+ const rule = this.formRules[child.prop];
150
150
  // 如果不存在对应的规则,直接返回,否则校验器会报错
151
151
  if (!rule) return;
152
152
  // rule规则可为数组形式,也可为对象形式,此处拼接成为数组
@@ -1,48 +1,44 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // input的label提示语
4
5
  label: {
5
6
  type: String,
6
- default: () => uni.$u.props.formItem.label
7
+ default: defprops.formItem.label
7
8
  },
8
9
  // 绑定的值
9
10
  prop: {
10
11
  type: String,
11
- default: () => uni.$u.props.formItem.prop
12
- },
13
- // 绑定的规则
14
- prop: {
15
- type: String,
16
- default: () => uni.$u.props.formItem.rule
12
+ default: defprops.formItem.prop
17
13
  },
18
14
  // 是否显示表单域的下划线边框
19
15
  borderBottom: {
20
16
  type: [String, Boolean],
21
- default: () => uni.$u.props.formItem.borderBottom
17
+ default: defprops.formItem.borderBottom
22
18
  },
23
19
  // label的宽度,单位px
24
20
  labelWidth: {
25
21
  type: [String, Number],
26
- default: () => uni.$u.props.formItem.labelWidth
22
+ default: defprops.formItem.labelWidth
27
23
  },
28
24
  // 右侧图标
29
25
  rightIcon: {
30
26
  type: String,
31
- default: () => uni.$u.props.formItem.rightIcon
27
+ default: defprops.formItem.rightIcon
32
28
  },
33
29
  // 左侧图标
34
30
  leftIcon: {
35
31
  type: String,
36
- default: () => uni.$u.props.formItem.leftIcon
32
+ default: defprops.formItem.leftIcon
37
33
  },
38
34
  // 是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置
39
35
  required: {
40
36
  type: Boolean,
41
- default: () => uni.$u.props.formItem.required
37
+ default: defprops.formItem.required
42
38
  },
43
39
  leftIconStyle: {
44
40
  type: [String, Object],
45
- default: () => uni.$u.props.formItem.leftIconStyle,
41
+ default: defprops.formItem.leftIconStyle,
46
42
  }
47
43
  }
48
44
  }
@@ -84,7 +84,6 @@
84
84
  * @tutorial https://ijry.github.io/uview-plus/components/form.html
85
85
  * @property {String} label input的label提示语
86
86
  * @property {String} prop 绑定的值
87
- * @property {String} rule 绑定的规则
88
87
  * @property {String | Boolean} borderBottom 是否显示表单域的下划线边框
89
88
  * @property {String | Number} labelWidth label的宽度,单位px
90
89
  * @property {String} rightIcon 右侧图标
@@ -1,24 +1,25 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 背景颜色(默认transparent)
4
5
  bgColor: {
5
6
  type: String,
6
- default: () => uni.$u.props.gap.bgColor
7
+ default: defprops.gap.bgColor
7
8
  },
8
9
  // 分割槽高度,单位px(默认30)
9
10
  height: {
10
11
  type: [String, Number],
11
- default: () => uni.$u.props.gap.height
12
+ default: defprops.gap.height
12
13
  },
13
14
  // 与上一个组件的距离
14
15
  marginTop: {
15
16
  type: [String, Number],
16
- default: () => uni.$u.props.gap.marginTop
17
+ default: defprops.gap.marginTop
17
18
  },
18
19
  // 与下一个组件的距离
19
20
  marginBottom: {
20
21
  type: [String, Number],
21
- default: () => uni.$u.props.gap.marginBottom
22
+ default: defprops.gap.marginBottom
22
23
  }
23
24
  }
24
25
  }
@@ -1,19 +1,20 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 分成几列
4
5
  col: {
5
6
  type: [String, Number],
6
- default: () => uni.$u.props.grid.col
7
+ default: defprops.grid.col
7
8
  },
8
9
  // 是否显示边框
9
10
  border: {
10
11
  type: Boolean,
11
- default: () => uni.$u.props.grid.border
12
+ default: defprops.grid.border
12
13
  },
13
14
  // 宫格对齐方式,表现为数量少的时候,靠左,居中,还是靠右
14
15
  align: {
15
16
  type: String,
16
- default: () => uni.$u.props.grid.align
17
+ default: defprops.grid.align
17
18
  }
18
19
  }
19
20
  }
@@ -1,14 +1,15 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 宫格的name
4
5
  name: {
5
6
  type: [String, Number, null],
6
- default: () => uni.$u.props.gridItem.name
7
+ default: defprops.gridItem.name
7
8
  },
8
9
  // 背景颜色
9
10
  bgColor: {
10
11
  type: String,
11
- default: () => uni.$u.props.gridItem.bgColor
12
+ default: defprops.gridItem.bgColor
12
13
  }
13
14
  }
14
15
  }
@@ -166,12 +166,7 @@
166
166
  }
167
167
  }
168
168
  },
169
- // #ifdef VUE2
170
169
  beforeDestroy() {
171
- // #endif
172
- // #ifdef VUE3
173
- beforeUnmount() {
174
- // #endif
175
170
  // 移除事件监听,释放性能
176
171
  uni.$off('$uGridItem')
177
172
  }