uview-plus 3.3.17 → 3.3.19

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.
package/changelog.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 3.3.19(2024-08-14)
2
+ fix: 修复2被rpx兼容处理只在数字值生效
3
+
4
+ add: 增加swiper自定义插槽示例
5
+
6
+ ## 3.3.18(2024-08-13)
7
+ feat: 新增支持datetime-picker工具栏插槽及picker插槽支持修复
1
8
  ## 3.3.17(2024-08-12)
2
9
  feat: swiper组件增加默认slot便于自定义
3
10
 
@@ -23,11 +23,20 @@
23
23
  :confirmText="confirmText"
24
24
  :cancelColor="cancelColor"
25
25
  :confirmColor="confirmColor"
26
+ :toolbarRightSlot="toolbarRightSlot"
26
27
  @close="close"
27
28
  @cancel="cancel"
28
29
  @confirm="confirm"
29
30
  @change="change"
30
31
  >
32
+ <template #toolbar-right>
33
+ <slot name="toolbar-right">
34
+ </slot>
35
+ </template>
36
+ <template #toolbar-bottom>
37
+ <slot name="toolbar-bottom">
38
+ </slot>
39
+ </template>
31
40
  </u-picker>
32
41
  </template>
33
42
 
@@ -93,6 +93,11 @@ export const props = defineMixin({
93
93
  immediateChange: {
94
94
  type: Boolean,
95
95
  default: () => defProps.picker.immediateChange
96
- }
96
+ },
97
+ // 工具栏右侧插槽是否开启
98
+ toolbarRightSlot: {
99
+ type: Boolean,
100
+ default: false
101
+ },
97
102
  }
98
103
  })
@@ -20,6 +20,7 @@
20
20
  :cancelText="cancelText"
21
21
  :confirmText="confirmText"
22
22
  :title="title"
23
+ :rightSlot="toolbarRightSlot ? true : false"
23
24
  @cancel="cancel"
24
25
  @confirm="confirm"
25
26
  >
@@ -31,6 +31,11 @@ export const props = defineMixin({
31
31
  title: {
32
32
  type: String,
33
33
  default: () => defProps.toolbar.title
34
+ },
35
+ // 开启右侧插槽
36
+ rightSlot: {
37
+ type: Boolean,
38
+ default: false
34
39
  }
35
40
  }
36
41
  })
@@ -27,20 +27,23 @@
27
27
  <view
28
28
  class="u-toolbar__right"
29
29
  >
30
- <slot name="right">
31
- <view
32
- class="u-toolbar__confirm__wrapper"
33
- hover-class="u-hover-class"
34
- >
35
- <text
36
- class="u-toolbar__wrapper__confirm"
37
- @tap="confirm"
38
- :style="{
39
- color: confirmColor
40
- }"
41
- >{{ confirmText }}</text>
42
- </view>
43
- </slot>
30
+ <view
31
+ v-if="!rightSlot"
32
+ class="u-toolbar__confirm__wrapper"
33
+ hover-class="u-hover-class"
34
+ >
35
+ <text
36
+ class="u-toolbar__wrapper__confirm"
37
+ @tap="confirm"
38
+ :style="{
39
+ color: confirmColor
40
+ }"
41
+ >{{ confirmText }}</text>
42
+ </view>
43
+ <template v-else>
44
+ <slot name="right">
45
+ </slot>
46
+ </template>
44
47
  </view>
45
48
  </view>
46
49
  </template>
@@ -66,6 +69,9 @@
66
69
  name: 'u-toolbar',
67
70
  mixins: [mpMixin, mixin, props],
68
71
  emits: ["confirm", "cancel"],
72
+ created() {
73
+ console.log(this.$slots)
74
+ },
69
75
  methods: {
70
76
  // 点击取消按钮
71
77
  cancel() {
@@ -181,7 +181,7 @@ export function addUnit(value = 'auto', unit = '') {
181
181
  if (!unit) {
182
182
  unit = config.unit || 'px'
183
183
  }
184
- if (unit == 'rpx') {
184
+ if (unit == 'rpx' && testNumber(String(value))) {
185
185
  value = value * 2
186
186
  }
187
187
  value = String(value)
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "id": "uview-plus",
3
3
  "name": "uview-plus",
4
- "displayName": "uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
- "version": "3.3.17",
6
- "description": "uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
4
+ "displayName": "零云®uview-plus3.0重磅发布,全面的Vue3移动组件库。",
5
+ "version": "3.3.19",
6
+ "description": "零云®uview-plus已兼容vue3,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
7
7
  "keywords": [
8
8
  "uview",
9
9
  "uview-plus",