uview-plus 3.1.48 → 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 (137) hide show
  1. package/changelog.md +5 -10
  2. package/components/u-action-sheet/props.js +11 -10
  3. package/components/u-album/props.js +12 -11
  4. package/components/u-alert/props.js +9 -8
  5. package/components/u-avatar/props.js +15 -14
  6. package/components/u-avatar-group/props.js +10 -9
  7. package/components/u-back-top/props.js +11 -10
  8. package/components/u-badge/props.js +15 -14
  9. package/components/u-button/props.js +29 -28
  10. package/components/u-calendar/month.vue +1 -1
  11. package/components/u-calendar/props.js +28 -27
  12. package/components/u-car-keyboard/props.js +1 -0
  13. package/components/u-cell/props.js +18 -17
  14. package/components/u-cell/u-cell.vue +2 -11
  15. package/components/u-cell-group/props.js +3 -2
  16. package/components/u-checkbox/props.js +14 -13
  17. package/components/u-checkbox-group/props.js +17 -16
  18. package/components/u-circle-progress/props.js +2 -1
  19. package/components/u-code/props.js +7 -6
  20. package/components/u-code/u-code.vue +0 -5
  21. package/components/u-code-input/props.js +17 -16
  22. package/components/u-col/props.js +6 -5
  23. package/components/u-collapse/props.js +4 -3
  24. package/components/u-collapse-item/props.js +12 -11
  25. package/components/u-column-notice/props.js +11 -10
  26. package/components/u-count-down/props.js +5 -4
  27. package/components/u-count-down/u-count-down.vue +0 -5
  28. package/components/u-count-to/props.js +12 -11
  29. package/components/u-datetime-picker/props.js +25 -24
  30. package/components/u-divider/props.js +9 -8
  31. package/components/u-dropdown/props.js +1 -0
  32. package/components/u-dropdown-item/props.js +1 -0
  33. package/components/u-empty/props.js +12 -11
  34. package/components/u-form/props.js +9 -8
  35. package/components/u-form/u-form.vue +1 -1
  36. package/components/u-form-item/props.js +9 -13
  37. package/components/u-form-item/u-form-item.vue +0 -1
  38. package/components/u-gap/props.js +5 -4
  39. package/components/u-grid/props.js +4 -3
  40. package/components/u-grid-item/props.js +3 -2
  41. package/components/u-grid-item/u-grid-item.vue +0 -5
  42. package/components/u-icon/props.js +18 -17
  43. package/components/u-icon/u-icon.vue +6 -9
  44. package/components/u-image/props.js +17 -16
  45. package/components/u-index-anchor/props.js +6 -5
  46. package/components/u-index-item/props.js +1 -0
  47. package/components/u-index-list/props.js +6 -5
  48. package/components/u-index-list/u-index-list.vue +1 -2
  49. package/components/u-input/props.js +36 -35
  50. package/components/u-keyboard/props.js +17 -16
  51. package/components/u-line/props.js +7 -6
  52. package/components/u-line-progress/props.js +6 -5
  53. package/components/u-link/props.js +8 -7
  54. package/components/u-list/props.js +15 -14
  55. package/components/u-list-item/props.js +2 -1
  56. package/components/u-loading-icon/props.js +12 -11
  57. package/components/u-loading-page/props.js +10 -9
  58. package/components/u-loadmore/props.js +19 -18
  59. package/components/u-modal/props.js +17 -16
  60. package/components/u-navbar/props.js +17 -16
  61. package/components/u-no-network/props.js +4 -3
  62. package/components/u-notice-bar/props.js +14 -13
  63. package/components/u-notify/props.js +10 -9
  64. package/components/u-notify/u-notify.vue +0 -5
  65. package/components/u-number-box/props.js +23 -22
  66. package/components/u-number-keyboard/props.js +4 -3
  67. package/components/u-overlay/props.js +5 -4
  68. package/components/u-parse/props.js +9 -8
  69. package/components/u-parse/u-parse.vue +1 -6
  70. package/components/u-picker/props.js +17 -16
  71. package/components/u-picker-column/props.js +1 -0
  72. package/components/u-popup/props.js +16 -15
  73. package/components/u-radio/props.js +14 -13
  74. package/components/u-radio-group/props.js +18 -17
  75. package/components/u-rate/props.js +15 -14
  76. package/components/u-read-more/props.js +9 -8
  77. package/components/u-row/props.js +4 -3
  78. package/components/u-row-notice/props.js +8 -7
  79. package/components/u-row-notice/u-row-notice.vue +0 -5
  80. package/components/u-safe-bottom/props.js +1 -0
  81. package/components/u-scroll-list/props.js +7 -6
  82. package/components/u-search/props.js +25 -24
  83. package/components/u-skeleton/props.js +12 -11
  84. package/components/u-slider/props.js +12 -11
  85. package/components/u-status-bar/props.js +2 -1
  86. package/components/u-steps/props.js +8 -7
  87. package/components/u-steps-item/props.js +5 -4
  88. package/components/u-sticky/props.js +7 -6
  89. package/components/u-sticky/u-sticky.vue +0 -5
  90. package/components/u-subsection/props.js +10 -9
  91. package/components/u-swipe-action/props.js +2 -1
  92. package/components/u-swipe-action-item/nvue.js +0 -5
  93. package/components/u-swipe-action-item/props.js +7 -6
  94. package/components/u-swiper/props.js +25 -24
  95. package/components/u-swiper-indicator/props.js +6 -5
  96. package/components/u-switch/props.js +12 -11
  97. package/components/u-tabbar/props.js +9 -8
  98. package/components/u-tabbar-item/props.js +7 -6
  99. package/components/u-table/props.js +1 -0
  100. package/components/u-tabs/props.js +13 -12
  101. package/components/u-tabs-item/props.js +1 -0
  102. package/components/u-tag/props.js +16 -15
  103. package/components/u-td/props.js +1 -0
  104. package/components/u-text/props.js +22 -21
  105. package/components/u-textarea/props.js +24 -23
  106. package/components/u-toast/u-toast.vue +0 -5
  107. package/components/u-toolbar/props.js +7 -6
  108. package/components/u-tooltip/props.js +12 -11
  109. package/components/u-tr/props.js +1 -0
  110. package/components/u-transition/props.js +5 -4
  111. package/components/u-transition/transition.js +9 -8
  112. package/components/u-upload/props.js +23 -22
  113. package/libs/config/props/actionSheet.js +1 -1
  114. package/libs/config/props/album.js +1 -1
  115. package/libs/config/props/avatarGroup.js +1 -1
  116. package/libs/config/props/backtop.js +2 -2
  117. package/libs/config/props/badge.js +1 -1
  118. package/libs/config/props/calendar.js +3 -3
  119. package/libs/config/props/checkboxGroup.js +1 -1
  120. package/libs/config/props/datetimePicker.js +1 -1
  121. package/libs/config/props/form.js +3 -3
  122. package/libs/config/props/formItem.js +0 -1
  123. package/libs/config/props/indexList.js +1 -1
  124. package/libs/config/props/noticeBar.js +1 -1
  125. package/libs/config/props/picker.js +2 -2
  126. package/libs/config/props/popup.js +1 -1
  127. package/libs/config/props/search.js +2 -2
  128. package/libs/config/props/slider.js +1 -1
  129. package/libs/config/props/swiper.js +1 -1
  130. package/libs/config/props/tabs.js +7 -7
  131. package/libs/config/props/text.js +2 -2
  132. package/libs/config/props/toast.js +1 -1
  133. package/libs/config/props/tooltip.js +1 -1
  134. package/libs/config/props/upload.js +3 -3
  135. package/libs/css/components.scss +1 -11
  136. package/libs/css/flex.scss +71 -73
  137. package/package.json +1 -1
@@ -1,130 +1,131 @@
1
+ import defprops from '../../libs/config/props';
1
2
  export default {
2
3
  props: {
3
4
  // 是否打开组件
4
5
  show: {
5
6
  type: Boolean,
6
- default: () => uni.$u.props.datetimePicker.show
7
+ default: defprops.datetimePicker.show
7
8
  },
8
9
  // 弹出的方向,可选值为 top bottom right left center
9
10
  popupMode: {
10
11
  type: String,
11
- default: () => uni.$u.props.picker.popupMode
12
+ default: defprops.picker.popupMode
12
13
  },
13
14
  // 是否展示顶部的操作栏
14
15
  showToolbar: {
15
16
  type: Boolean,
16
- default: () => uni.$u.props.datetimePicker.showToolbar
17
+ default: defprops.datetimePicker.showToolbar
17
18
  },
18
19
  // #ifdef VUE2
19
20
  // 绑定值
20
21
  value: {
21
22
  type: [String, Number],
22
- default: () => uni.$u.props.datetimePicker.value
23
+ default: defprops.datetimePicker.value
23
24
  },
24
25
  // #endif
25
26
  // #ifdef VUE3
26
27
  // 绑定值
27
28
  modelValue: {
28
29
  type: [String, Number],
29
- default: () => uni.$u.props.datetimePicker.value
30
+ default: defprops.datetimePicker.value
30
31
  },
31
32
  // #endif
32
33
  // 顶部标题
33
34
  title: {
34
35
  type: String,
35
- default: () => uni.$u.props.datetimePicker.title
36
+ default: defprops.datetimePicker.title
36
37
  },
37
38
  // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
38
39
  mode: {
39
40
  type: String,
40
- default: () => uni.$u.props.datetimePicker.mode
41
+ default: defprops.datetimePicker.mode
41
42
  },
42
43
  // 可选的最大时间
43
44
  maxDate: {
44
45
  type: Number,
45
46
  // 最大默认值为后10年
46
- default: () => uni.$u.props.datetimePicker.maxDate
47
+ default: defprops.datetimePicker.maxDate
47
48
  },
48
49
  // 可选的最小时间
49
50
  minDate: {
50
51
  type: Number,
51
52
  // 最小默认值为前10年
52
- default: () => uni.$u.props.datetimePicker.minDate
53
+ default: defprops.datetimePicker.minDate
53
54
  },
54
55
  // 可选的最小小时,仅mode=time有效
55
56
  minHour: {
56
57
  type: Number,
57
- default: () => uni.$u.props.datetimePicker.minHour
58
+ default: defprops.datetimePicker.minHour
58
59
  },
59
60
  // 可选的最大小时,仅mode=time有效
60
61
  maxHour: {
61
62
  type: Number,
62
- default: () => uni.$u.props.datetimePicker.maxHour
63
+ default: defprops.datetimePicker.maxHour
63
64
  },
64
65
  // 可选的最小分钟,仅mode=time有效
65
66
  minMinute: {
66
67
  type: Number,
67
- default: () => uni.$u.props.datetimePicker.minMinute
68
+ default: defprops.datetimePicker.minMinute
68
69
  },
69
70
  // 可选的最大分钟,仅mode=time有效
70
71
  maxMinute: {
71
72
  type: Number,
72
- default: () => uni.$u.props.datetimePicker.maxMinute
73
+ default: defprops.datetimePicker.maxMinute
73
74
  },
74
75
  // 选项过滤函数
75
76
  filter: {
76
77
  type: [Function, null],
77
- default: () => uni.$u.props.datetimePicker.filter
78
+ default: defprops.datetimePicker.filter
78
79
  },
79
80
  // 选项格式化函数
80
81
  formatter: {
81
82
  type: [Function, null],
82
- default: () => uni.$u.props.datetimePicker.formatter
83
+ default: defprops.datetimePicker.formatter
83
84
  },
84
85
  // 是否显示加载中状态
85
86
  loading: {
86
87
  type: Boolean,
87
- default: () => uni.$u.props.datetimePicker.loading
88
+ default: defprops.datetimePicker.loading
88
89
  },
89
90
  // 各列中,单个选项的高度
90
91
  itemHeight: {
91
92
  type: [String, Number],
92
- default: () => uni.$u.props.datetimePicker.itemHeight
93
+ default: defprops.datetimePicker.itemHeight
93
94
  },
94
95
  // 取消按钮的文字
95
96
  cancelText: {
96
97
  type: String,
97
- default: () => uni.$u.props.datetimePicker.cancelText
98
+ default: defprops.datetimePicker.cancelText
98
99
  },
99
100
  // 确认按钮的文字
100
101
  confirmText: {
101
102
  type: String,
102
- default: () => uni.$u.props.datetimePicker.confirmText
103
+ default: defprops.datetimePicker.confirmText
103
104
  },
104
105
  // 取消按钮的颜色
105
106
  cancelColor: {
106
107
  type: String,
107
- default: () => uni.$u.props.datetimePicker.cancelColor
108
+ default: defprops.datetimePicker.cancelColor
108
109
  },
109
110
  // 确认按钮的颜色
110
111
  confirmColor: {
111
112
  type: String,
112
- default: () => uni.$u.props.datetimePicker.confirmColor
113
+ default: defprops.datetimePicker.confirmColor
113
114
  },
114
115
  // 每列中可见选项的数量
115
116
  visibleItemCount: {
116
117
  type: [String, Number],
117
- default: () => uni.$u.props.datetimePicker.visibleItemCount
118
+ default: defprops.datetimePicker.visibleItemCount
118
119
  },
119
120
  // 是否允许点击遮罩关闭选择器
120
121
  closeOnClickOverlay: {
121
122
  type: Boolean,
122
- default: () => uni.$u.props.datetimePicker.closeOnClickOverlay
123
+ default: defprops.datetimePicker.closeOnClickOverlay
123
124
  },
124
125
  // 各列的默认索引
125
126
  defaultIndex: {
126
127
  type: Array,
127
- default: () => uni.$u.props.datetimePicker.defaultIndex
128
+ default: defprops.datetimePicker.defaultIndex
128
129
  }
129
130
  }
130
131
  }
@@ -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
  }
@@ -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
  }