stellar-ui-plus 1.25.1 → 1.25.3
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/components/ste-animate/ATTRIBUTES.md +13 -5
- package/components/ste-animate/README.md +4 -28
- package/components/ste-animate/ste-animate.easycom.json +31 -9
- package/components/ste-app-update/ATTRIBUTES.md +11 -5
- package/components/ste-app-update/README.md +1 -3
- package/components/ste-app-update/method.ts +44 -1
- package/components/ste-app-update/props.ts +17 -2
- package/components/ste-app-update/ste-app-update.easycom.json +18 -8
- package/components/ste-app-update/ste-app-update.vue +93 -18
- package/components/ste-area-chart/ATTRIBUTES.md +3 -1
- package/components/ste-area-chart/README.md +21 -4
- package/components/ste-area-chart/ste-area-chart.vue +33 -1
- package/components/ste-badge/ATTRIBUTES.md +10 -1
- package/components/ste-badge/README.md +9 -18
- package/components/ste-badge/ste-badge.easycom.json +8 -0
- package/components/ste-bar-chart/ATTRIBUTES.md +3 -1
- package/components/ste-bar-chart/README.md +20 -5
- package/components/ste-bar-chart/ste-bar-chart.vue +34 -1
- package/components/ste-barcode/ATTRIBUTES.md +6 -2
- package/components/ste-barcode/README.md +3 -5
- package/components/ste-barcode/ste-barcode.easycom.json +1 -2
- package/components/ste-button/ATTRIBUTES.md +24 -14
- package/components/ste-button/README.md +11 -19
- package/components/ste-button/ste-button.easycom.json +76 -12
- package/components/ste-calendar/ATTRIBUTES.md +12 -2
- package/components/ste-calendar/README.md +16 -24
- package/components/ste-calendar/ste-calendar.easycom.json +4 -3
- package/components/ste-category/ATTRIBUTES.md +6 -2
- package/components/ste-category/README.md +2 -4
- package/components/ste-category/ste-category.easycom.json +1 -2
- package/components/ste-checkbox/ATTRIBUTES.md +6 -2
- package/components/ste-checkbox/README.md +18 -20
- package/components/ste-checkbox/ste-checkbox.easycom.json +1 -3
- package/components/ste-checkbox/ste-checkbox.vue +71 -80
- package/components/ste-code-input/ATTRIBUTES.md +8 -4
- package/components/ste-code-input/README.md +7 -9
- package/components/ste-code-input/ste-code-input.easycom.json +13 -4
- package/components/ste-column-chart/ATTRIBUTES.md +3 -1
- package/components/ste-column-chart/README.md +22 -7
- package/components/ste-column-chart/ste-column-chart.vue +34 -1
- package/components/ste-comment/ATTRIBUTES.md +3 -1
- package/components/ste-comment/README.md +2 -4
- package/components/ste-coupon-list/ATTRIBUTES.md +15 -5
- package/components/ste-coupon-list/README.md +6 -14
- package/components/ste-coupon-list/ste-coupon-list.easycom.json +22 -3
- package/components/ste-custom-keyboard/ATTRIBUTES.md +16 -7
- package/components/ste-custom-keyboard/README.md +10 -18
- package/components/ste-custom-keyboard/ste-custom-keyboard.easycom.json +28 -10
- package/components/ste-date-picker/ATTRIBUTES.md +9 -5
- package/components/ste-date-picker/README.md +9 -11
- package/components/ste-date-picker/ste-date-picker.easycom.json +19 -4
- package/components/ste-date-user/ATTRIBUTES.md +9 -1
- package/components/ste-date-user/README.md +3 -11
- package/components/ste-date-user/ste-date-user.easycom.json +4 -0
- package/components/ste-drag/ATTRIBUTES.md +13 -3
- package/components/ste-drag/README.md +5 -13
- package/components/ste-drag/ste-drag.easycom.json +10 -2
- package/components/ste-drag-sort/ATTRIBUTES.md +25 -0
- package/components/ste-drag-sort/README.md +116 -0
- package/components/ste-drag-sort/config.json +5 -0
- package/components/ste-drag-sort/props.ts +16 -0
- package/components/ste-drag-sort/ste-drag-sort.easycom.json +88 -0
- package/components/ste-drag-sort/ste-drag-sort.vue +589 -0
- package/components/ste-dropdown-menu/ATTRIBUTES.md +8 -4
- package/components/ste-dropdown-menu/README.md +14 -16
- package/components/ste-dropdown-menu/ste-dropdown-menu.easycom.json +13 -4
- package/components/ste-filter-tool/ATTRIBUTES.md +6 -2
- package/components/ste-filter-tool/README.md +4 -6
- package/components/ste-filter-tool/ste-filter-tool.easycom.json +1 -5
- package/components/ste-function-list/ATTRIBUTES.md +13 -2
- package/components/ste-function-list/README.md +3 -12
- package/components/ste-function-list/ste-function-list.easycom.json +8 -3
- package/components/ste-funnel-chart/ATTRIBUTES.md +3 -1
- package/components/ste-funnel-chart/README.md +21 -6
- package/components/ste-funnel-chart/ste-funnel-chart.vue +34 -1
- package/components/ste-goods-info/ATTRIBUTES.md +15 -4
- package/components/ste-goods-info/README.md +8 -17
- package/components/ste-goods-info/ste-goods-info.easycom.json +40 -13
- package/components/ste-goods-list/ATTRIBUTES.md +9 -1
- package/components/ste-goods-list/README.md +4 -12
- package/components/ste-goods-list/ste-goods-list.easycom.json +4 -0
- package/components/ste-guide-qa/ATTRIBUTES.md +15 -4
- package/components/ste-guide-qa/README.md +6 -15
- package/components/ste-guide-qa/ste-guide-qa.easycom.json +20 -2
- package/components/ste-icon/ATTRIBUTES.md +7 -3
- package/components/ste-icon/README.md +5 -7
- package/components/ste-icon/ste-icon.easycom.json +7 -2
- package/components/ste-image/ATTRIBUTES.md +13 -2
- package/components/ste-image/README.md +6 -15
- package/components/ste-image/ste-image.easycom.json +8 -3
- package/components/ste-index-list/ATTRIBUTES.md +8 -4
- package/components/ste-index-list/README.md +6 -8
- package/components/ste-index-list/ste-index-list.easycom.json +13 -3
- package/components/ste-input/ATTRIBUTES.md +14 -3
- package/components/ste-input/README.md +16 -25
- package/components/ste-input/ste-input.easycom.json +14 -5
- package/components/ste-line-chart/ATTRIBUTES.md +3 -1
- package/components/ste-line-chart/README.md +22 -7
- package/components/ste-line-chart/ste-line-chart.vue +34 -1
- package/components/ste-loading/ATTRIBUTES.md +3 -1
- package/components/ste-loading/README.md +6 -8
- package/components/ste-login/ATTRIBUTES.md +12 -2
- package/components/ste-login/README.md +7 -15
- package/components/ste-login/ste-login.easycom.json +4 -7
- package/components/ste-login-info/ATTRIBUTES.md +6 -2
- package/components/ste-login-info/README.md +2 -4
- package/components/ste-login-info/ste-login-info.easycom.json +1 -4
- package/components/ste-marquee/ATTRIBUTES.md +44 -0
- package/components/ste-marquee/README.md +123 -0
- package/components/ste-marquee/config.json +5 -0
- package/components/ste-marquee/props.ts +106 -0
- package/components/ste-marquee/ste-marquee.easycom.json +132 -0
- package/components/ste-marquee/ste-marquee.vue +249 -0
- package/components/ste-media-preview/ATTRIBUTES.md +14 -4
- package/components/ste-media-preview/README.md +23 -32
- package/components/ste-media-preview/ste-media-preview.easycom.json +16 -4
- package/components/ste-message-box/ATTRIBUTES.md +3 -1
- package/components/ste-message-box/README.md +11 -13
- package/components/ste-navbar/ATTRIBUTES.md +13 -3
- package/components/ste-navbar/README.md +5 -13
- package/components/ste-navbar/ste-navbar.easycom.json +10 -1
- package/components/ste-notice-bar/ATTRIBUTES.md +16 -5
- package/components/ste-notice-bar/README.md +11 -20
- package/components/ste-notice-bar/ste-notice-bar.easycom.json +26 -3
- package/components/ste-number-keyboard/ATTRIBUTES.md +17 -7
- package/components/ste-number-keyboard/README.md +9 -18
- package/components/ste-number-keyboard/ste-number-keyboard.easycom.json +32 -9
- package/components/ste-order-card/ATTRIBUTES.md +6 -2
- package/components/ste-order-card/README.md +4 -6
- package/components/ste-order-card/ste-order-card.easycom.json +1 -4
- package/components/ste-pie-chart/ATTRIBUTES.md +3 -1
- package/components/ste-pie-chart/README.md +21 -6
- package/components/ste-pie-chart/ste-pie-chart.vue +34 -1
- package/components/ste-popup/ATTRIBUTES.md +15 -5
- package/components/ste-popup/README.md +10 -18
- package/components/ste-popup/ste-popup.easycom.json +22 -4
- package/components/ste-price/ATTRIBUTES.md +7 -3
- package/components/ste-price/README.md +10 -12
- package/components/ste-price/ste-price.easycom.json +7 -2
- package/components/ste-progress/ATTRIBUTES.md +9 -1
- package/components/ste-progress/README.md +9 -17
- package/components/ste-progress/ste-progress.easycom.json +4 -0
- package/components/ste-qrcode/ATTRIBUTES.md +6 -2
- package/components/ste-qrcode/README.md +4 -6
- package/components/ste-qrcode/ste-qrcode.easycom.json +1 -2
- package/components/ste-radio/ATTRIBUTES.md +6 -2
- package/components/ste-radio/README.md +17 -19
- package/components/ste-radio/ste-radio.easycom.json +1 -3
- package/components/ste-radio/ste-radio.vue +109 -85
- package/components/ste-rate/ATTRIBUTES.md +7 -3
- package/components/ste-rate/README.md +8 -10
- package/components/ste-rate/ste-rate.easycom.json +7 -2
- package/components/ste-read-more/ATTRIBUTES.md +20 -4
- package/components/ste-read-more/README.md +5 -19
- package/components/ste-read-more/ste-read-more.easycom.json +20 -2
- package/components/ste-rich-text/ATTRIBUTES.md +3 -1
- package/components/ste-rich-text/README.md +2 -4
- package/components/ste-ring-chart/ATTRIBUTES.md +3 -1
- package/components/ste-ring-chart/README.md +22 -5
- package/components/ste-ring-chart/ste-ring-chart.vue +33 -1
- package/components/ste-scroll-to/ATTRIBUTES.md +7 -3
- package/components/ste-scroll-to/README.md +2 -4
- package/components/ste-scroll-to/ste-scroll-to.easycom.json +7 -2
- package/components/ste-search/ATTRIBUTES.md +14 -3
- package/components/ste-search/README.md +12 -21
- package/components/ste-search/ste-search.easycom.json +14 -7
- package/components/ste-search-box/ATTRIBUTES.md +6 -2
- package/components/ste-search-box/README.md +3 -5
- package/components/ste-search-box/ste-search-box.easycom.json +1 -3
- package/components/ste-select/ATTRIBUTES.md +9 -5
- package/components/ste-select/README.md +11 -11
- package/components/ste-select/ste-select.easycom.json +19 -6
- package/components/ste-select-seat/ATTRIBUTES.md +8 -4
- package/components/ste-select-seat/README.md +7 -21
- package/components/ste-select-seat/ste-select-seat.easycom.json +13 -3
- package/components/ste-signature/ATTRIBUTES.md +18 -5
- package/components/ste-signature/README.md +3 -14
- package/components/ste-signature/ste-signature.easycom.json +50 -3
- package/components/ste-simple-calendar/ATTRIBUTES.md +16 -4
- package/components/ste-simple-calendar/README.md +8 -18
- package/components/ste-simple-calendar/ste-simple-calendar.easycom.json +30 -2
- package/components/ste-skeleton/ATTRIBUTES.md +9 -1
- package/components/ste-skeleton/README.md +5 -13
- package/components/ste-skeleton/ste-skeleton.easycom.json +4 -0
- package/components/ste-slide-verify/ATTRIBUTES.md +16 -5
- package/components/ste-slide-verify/README.md +7 -16
- package/components/ste-slide-verify/ste-slide-verify.easycom.json +26 -3
- package/components/ste-slider/ATTRIBUTES.md +14 -2
- package/components/ste-slider/README.md +11 -21
- package/components/ste-slider/ste-slider.easycom.json +12 -4
- package/components/ste-stepper/ATTRIBUTES.md +9 -5
- package/components/ste-stepper/README.md +9 -13
- package/components/ste-stepper/ste-stepper.easycom.json +19 -6
- package/components/ste-steps/ATTRIBUTES.md +6 -2
- package/components/ste-steps/README.md +9 -11
- package/components/ste-steps/ste-steps.easycom.json +1 -2
- package/components/ste-sticky/ATTRIBUTES.md +8 -4
- package/components/ste-sticky/README.md +2 -4
- package/components/ste-sticky/ste-sticky.easycom.json +13 -3
- package/components/ste-swipe-action/ATTRIBUTES.md +14 -3
- package/components/ste-swipe-action/README.md +9 -18
- package/components/ste-swipe-action/ste-swipe-action.easycom.json +20 -2
- package/components/ste-swipe-action/useData.ts +15 -8
- package/components/ste-swipe-action-group/ATTRIBUTES.md +6 -2
- package/components/ste-swipe-action-group/ste-swipe-action-group.easycom.json +1 -3
- package/components/ste-swiper/ATTRIBUTES.md +6 -2
- package/components/ste-swiper/README.md +12 -14
- package/components/ste-swiper/ste-swiper.easycom.json +1 -3
- package/components/ste-switch/ATTRIBUTES.md +8 -4
- package/components/ste-switch/README.md +7 -9
- package/components/ste-switch/ste-switch.easycom.json +13 -3
- package/components/ste-tab/ATTRIBUTES.md +3 -1
- package/components/ste-table/ATTRIBUTES.md +12 -8
- package/components/ste-table/README.md +23 -23
- package/components/ste-table/ste-table.easycom.json +38 -9
- package/components/ste-tabs/ATTRIBUTES.md +9 -4
- package/components/ste-tabs/README.md +4 -6
- package/components/ste-tabs/props.ts +3 -0
- package/components/ste-tabs/ste-tabs.easycom.json +18 -2
- package/components/ste-tabs/useData.ts +1 -1
- package/components/ste-text/ATTRIBUTES.md +9 -1
- package/components/ste-text/README.md +4 -12
- package/components/ste-text/ste-text.easycom.json +4 -0
- package/components/ste-toast/ATTRIBUTES.md +10 -1
- package/components/ste-toast/README.md +9 -18
- package/components/ste-toast/ste-toast.easycom.json +14 -0
- package/components/ste-touch-swipe/ATTRIBUTES.md +6 -2
- package/components/ste-touch-swipe/README.md +4 -6
- package/components/ste-touch-swipe/ste-touch-swipe.easycom.json +1 -2
- package/components/ste-tour/ATTRIBUTES.md +7 -3
- package/components/ste-tour/README.md +5 -7
- package/components/ste-tour/ste-tour.easycom.json +11 -4
- package/components/ste-tree/ATTRIBUTES.md +15 -2
- package/components/ste-tree/README.md +6 -17
- package/components/ste-tree/ste-tree.easycom.json +16 -4
- package/components/ste-upload/ATTRIBUTES.md +17 -5
- package/components/ste-upload/README.md +9 -20
- package/components/ste-upload/ste-upload.easycom.json +36 -9
- package/components/ste-user-info/ATTRIBUTES.md +15 -5
- package/components/ste-user-info/README.md +5 -13
- package/components/ste-user-info/ste-user-info.easycom.json +22 -4
- package/components/ste-video/ATTRIBUTES.md +3 -1
- package/components/ste-video/README.md +4 -8
- package/components/ste-watermark/ATTRIBUTES.md +3 -1
- package/components/ste-watermark/README.md +5 -7
- package/config/font-size.ts +3 -0
- package/config/index.ts +5 -0
- package/index.ts +4 -0
- package/package.json +1 -1
- package/types/components.d.ts +4 -0
- package/types/refComponents.d.ts +4 -0
- package/utils/System.ts +50 -15
- package/utils/mixin.ts +4 -3
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 代码演示
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 背景色
|
|
10
10
|
|
|
11
11
|
- 背景色支持纯色、渐变色、图片
|
|
12
12
|
- 支持设置激活部分的背景(`activeBg`)和未激活部分(`inactiveBg`)的背景
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
</template>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## 线条粗细
|
|
23
23
|
|
|
24
24
|
- 通过`strokeWidth`设置线条的粗细
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</template>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## 禁用
|
|
34
34
|
|
|
35
35
|
```html
|
|
36
36
|
<template>
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
## 长度
|
|
42
42
|
|
|
43
43
|
- 通过`width`设置进度条长度
|
|
44
44
|
- 默认是`100%`,跟随父容器的宽度
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
</template>
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
## 动画时间
|
|
54
54
|
|
|
55
55
|
```html
|
|
56
56
|
<template>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
## 自定义文字内容
|
|
62
62
|
|
|
63
63
|
- 通过`pivotText`属性来自定义进度条内文字显示的内容
|
|
64
64
|
- 通过`textColor`属性来自定义进度条内文字的颜色
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
</template>
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
## 文本显示阈值
|
|
78
78
|
|
|
79
79
|
- 当进度条百分比(`percentage`)小于阈值时(`displayTextThreshold`),进度条的内容将不会显示
|
|
80
80
|
- 默认阈值是`0`,此时内容将始终显示
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</template>
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
## 阶段配置
|
|
90
90
|
|
|
91
91
|
```html
|
|
92
92
|
<script lang="ts" setup>
|
|
@@ -104,15 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
---$
|
|
106
106
|
|
|
107
|
-
### API
|
|
108
|
-
|
|
109
107
|
<!-- props -->
|
|
110
108
|
|
|
111
|
-
#### Slots
|
|
112
|
-
|
|
113
|
-
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
114
|
-
| --------- | ---------- | -------- | -------- |
|
|
115
|
-
| `default` | 进度条内容 | - | - |
|
|
116
|
-
|
|
117
109
|
---$
|
|
118
110
|
{{fuyuwei}}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
6
|
| `content` | 二维码内容 | `string` | - | - | - |
|
|
@@ -10,7 +12,9 @@
|
|
|
10
12
|
| `foregroundImageHeight` | logo图高度,默认二维码尺寸的四分之一 | `string` | `size / 4` | - | - |
|
|
11
13
|
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
### Events
|
|
14
16
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
15
17
|
| ----- | ----- | ------- | -------- |
|
|
16
18
|
| `loadImage` | 加载完成后返回条形码对应的图片数据 | `src`:图片数据 | - |
|
|
19
|
+
|
|
20
|
+
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 代码演示
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 基础使用
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<template>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
## 自定义颜色
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
20
|
<template>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
## 带logo
|
|
26
26
|
|
|
27
27
|
```html
|
|
28
28
|
<template>
|
|
@@ -32,8 +32,6 @@
|
|
|
32
32
|
|
|
33
33
|
---$
|
|
34
34
|
|
|
35
|
-
### API
|
|
36
|
-
|
|
37
35
|
<!-- props -->
|
|
38
36
|
|
|
39
37
|
---$
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
6
|
| `v-model` | 当前值 | `string` | - | - | - |
|
|
@@ -18,8 +20,10 @@
|
|
|
18
20
|
| `columnGap` | 单选框和文本间距,单位rpx | `number / string` | `16` | - | - |
|
|
19
21
|
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
### Events
|
|
22
24
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
23
25
|
| ----- | ----- | ------- | -------- |
|
|
24
26
|
| `click` | 点击复选框时触发的事件 | `value`:当前复选框的绑定值<br/>`suspend`:等待<br/>`next`:继续<br/>`stop`:停止 | - |
|
|
25
27
|
| `change` | 当绑定值变化时触发的事件 | `value`:当前复选框的绑定值 | - |
|
|
28
|
+
|
|
29
|
+
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
- 由于性能不如原生组件,若数据量较多时推荐使用虚拟列表的形式渲染或者直接使用原生组件
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 代码演示
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## 基础用法
|
|
12
12
|
|
|
13
13
|
通过`v-model`绑定值当前选中项的 name 。
|
|
14
14
|
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</template>
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## 禁用
|
|
27
27
|
|
|
28
28
|
通过设置 `disabled` 属性可以禁用单选框, 默认`false`。
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
</template>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
## 只读
|
|
42
42
|
|
|
43
43
|
通过设置 `readonly` 属性可以禁用单选框,样式不置灰, 默认`false`。
|
|
44
44
|
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
</template>
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
## 自定义形状
|
|
57
57
|
|
|
58
58
|
通过设置`shape`为`square`或者`circle`,将单选框设置为方形或者圆形,默认`circle`。
|
|
59
59
|
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
</template>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
## 自定义图标大小
|
|
72
72
|
|
|
73
73
|
通过设置 `iconSize` 属性可以自定义图标的大小,单位`rpx`,默认`36`。
|
|
74
74
|
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</template>
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
## 自定义图标颜色
|
|
87
87
|
|
|
88
88
|
通过设置 `checkedColor` 属性可以自定义图标的颜色(填充色和边框色),默认`#0090FF`。
|
|
89
89
|
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
</template>
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
## 自定义图标
|
|
102
102
|
|
|
103
103
|
通过 `icon` 插槽自定义图标,可以通过 `slotProps`下`checked`判断是否为选中状态,`disabled`判断是否为禁止状态,`readonly`判断是否为只读状态。
|
|
104
104
|
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
</template>
|
|
136
136
|
```
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
## 左侧文本
|
|
139
139
|
|
|
140
140
|
将 `textPosition` 属性设置为 `left`,可以将文本位置调整到单选框左侧。
|
|
141
141
|
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
</template>
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
## 自定义文本
|
|
154
154
|
|
|
155
155
|
- 通过设置 `textSize` 属性可以自定义文本的大小,单位`rpx`,默认`28`。
|
|
156
156
|
- 通过设置 `textInactiveColor` 属性可以自定义文本未选中颜色,默认`#000000`。
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
</template>
|
|
164
164
|
```
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
## 回调事件
|
|
167
167
|
|
|
168
168
|
- `click` 点击单选框时触发的事件(可拦截change事件),`value`:改变后的分值,`allowStop`:允许阻止后续的事件触发,:`resolve`:后续的事件执行。
|
|
169
169
|
- `change` 当绑定值变化时触发的事件,`value`:改变后的分值。
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
</template>
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
-
|
|
187
|
+
## 单选框组
|
|
188
188
|
|
|
189
189
|
需要与`ste-radio-group`一起使用,通过`value`绑定在`ste-radio-group`,`value`即为选中的`ste-radio`的`name`属性设置的值。
|
|
190
190
|
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
</template>
|
|
203
203
|
```
|
|
204
204
|
|
|
205
|
-
|
|
205
|
+
## 单选框组属性和单选框属性
|
|
206
206
|
|
|
207
207
|
属性优先级:`ste-radio`组件上配置的属性 > `ste-radio-group`组件上配置的属性 > `ste-radio`组件默认属性
|
|
208
208
|
|
|
@@ -220,7 +220,7 @@
|
|
|
220
220
|
</template>
|
|
221
221
|
```
|
|
222
222
|
|
|
223
|
-
|
|
223
|
+
## 水平排列
|
|
224
224
|
|
|
225
225
|
将 `direction` 属性设置为 `row` 后,单选框组会变成水平排列。
|
|
226
226
|
|
|
@@ -240,11 +240,9 @@
|
|
|
240
240
|
|
|
241
241
|
---$
|
|
242
242
|
|
|
243
|
-
### API
|
|
244
|
-
|
|
245
243
|
<!-- props -->
|
|
246
244
|
|
|
247
|
-
|
|
245
|
+
## RadioGroup 组件属性(Props)
|
|
248
246
|
|
|
249
247
|
| 参数 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
250
248
|
| ------------------- | --------------------------------- | --------------- | --------- | --------------------------------- | --------- |
|
|
@@ -264,13 +262,13 @@
|
|
|
264
262
|
| `marginRight` | 右边距,单位rpx | `Number/String` | `0` | - | `v1.10.0` |
|
|
265
263
|
| `columnGap` | 单选框和文本间距,单位rpx | `Number/String` | `16` | - | `v1.10.0` |
|
|
266
264
|
|
|
267
|
-
|
|
265
|
+
## RadioGroup Events
|
|
268
266
|
|
|
269
267
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
270
268
|
| -------- | ------------------------ | ----------------------- | -------- |
|
|
271
269
|
| `change` | 当绑定值变化时触发的事件 | `value`:改变后的绑定值 | - |
|
|
272
270
|
|
|
273
|
-
|
|
271
|
+
## Radio Slots
|
|
274
272
|
|
|
275
273
|
| 插槽名 | 说明 | 插槽参数 | 支持版本 |
|
|
276
274
|
| --------- | -------------- | ------------------------------------------------------------ | -------- |
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
{
|
|
116
116
|
"name": "[event]click",
|
|
117
117
|
"description": "点击复选框时触发的事件",
|
|
118
|
-
"type": "(value:string | number,suspend: ()=>void,next: ()=>void,stop: ()=>void) => void",
|
|
119
118
|
"params": [
|
|
120
119
|
{
|
|
121
120
|
"name": "value",
|
|
@@ -138,7 +137,6 @@
|
|
|
138
137
|
{
|
|
139
138
|
"name": "[event]change",
|
|
140
139
|
"description": "当绑定值变化时触发的事件",
|
|
141
|
-
"type": "(value: string | number) => void",
|
|
142
140
|
"params": [
|
|
143
141
|
{
|
|
144
142
|
"name": "value",
|
|
@@ -147,4 +145,4 @@
|
|
|
147
145
|
]
|
|
148
146
|
}
|
|
149
147
|
]
|
|
150
|
-
}
|
|
148
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useSlots, computed, type CSSProperties } from 'vue';
|
|
2
|
+
import { useSlots, computed, ref, watch, type CSSProperties } from 'vue';
|
|
3
3
|
import { useColorStore } from '../../store/color';
|
|
4
4
|
import utils from '../../utils/utils';
|
|
5
5
|
import propsData, { RADIO_KEY, type RadioEmits } from './props';
|
|
6
6
|
import type { RadioGroupProps } from '../ste-radio-group/props';
|
|
7
7
|
import { useInject } from '../../utils/mixin';
|
|
8
8
|
|
|
9
|
-
// 🚀
|
|
9
|
+
// 🚀 模块级别调用,所有实例共享
|
|
10
10
|
const { getColor } = useColorStore();
|
|
11
11
|
const themeColor = getColor()?.steThemeColor || '#0090FF';
|
|
12
12
|
|
|
@@ -23,135 +23,157 @@ const slots = useSlots();
|
|
|
23
23
|
|
|
24
24
|
const Parent = useInject<{ props: Required<RadioGroupProps>; updateValue: (value: string) => void }>(RADIO_KEY);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
// 🚀 优化: 使用 watch 而非 computed,避免频繁依赖追踪
|
|
27
|
+
const parentData = ref<{ props: Required<RadioGroupProps>; updateValue: (value: string) => void } | null>(null);
|
|
28
|
+
|
|
29
|
+
watch(
|
|
30
|
+
() => Parent?.parent,
|
|
31
|
+
newParent => {
|
|
32
|
+
parentData.value = newParent || null;
|
|
33
|
+
},
|
|
34
|
+
{ immediate: true }
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
// 是否在 group 中
|
|
38
|
+
const inGroup = computed(() => !!parentData.value);
|
|
39
|
+
|
|
40
|
+
// ─── 各 prop 单独 computed,直接使用 parentData ──────────────────────────
|
|
41
|
+
|
|
42
|
+
const cmpDisabled = computed(() => props.disabled ?? parentData.value?.props.disabled ?? false);
|
|
43
|
+
const cmpReadonly = computed(() => props.readonly ?? parentData.value?.props.readonly ?? false);
|
|
44
|
+
const cmpShape = computed(() => props.shape ?? parentData.value?.props.shape ?? 'circle');
|
|
45
|
+
const cmpIconSize = computed(() => props.iconSize ?? parentData.value?.props.iconSize ?? 36);
|
|
46
|
+
const cmpCheckedColor = computed(() => props.checkedColor ?? parentData.value?.props.checkedColor ?? themeColor);
|
|
47
|
+
const cmpTextPosition = computed(() => props.textPosition ?? parentData.value?.props.textPosition ?? 'right');
|
|
48
|
+
const cmpTextSize = computed(() => props.textSize ?? parentData.value?.props.textSize ?? 28);
|
|
49
|
+
const cmpTextInactiveColor = computed(() => props.textInactiveColor ?? parentData.value?.props.textInactiveColor ?? '#000000');
|
|
50
|
+
const cmpTextActiveColor = computed(() => props.textActiveColor ?? parentData.value?.props.textActiveColor ?? '#000000');
|
|
51
|
+
const cmpTextDisabled = computed(() => props.textDisabled ?? parentData.value?.props.textDisabled ?? false);
|
|
52
|
+
const cmpMarginLeft = computed(() => props.marginLeft ?? parentData.value?.props.marginLeft ?? '0');
|
|
53
|
+
const cmpMarginRight = computed(() => props.marginRight ?? parentData.value?.props.marginRight ?? '0');
|
|
54
|
+
const cmpColumnGap = computed(() => props.columnGap ?? parentData.value?.props.columnGap ?? '16');
|
|
55
|
+
|
|
56
|
+
// ─── 选中状态 ───────────────────────────────────────────────────────────────
|
|
27
57
|
|
|
28
|
-
// 🚀 优化: 只保留必要的 computed
|
|
29
58
|
const cmpChecked = computed(() => {
|
|
30
|
-
|
|
59
|
+
if (inGroup.value) {
|
|
60
|
+
return parentData.value!.props.modelValue == props.name;
|
|
61
|
+
}
|
|
62
|
+
return props.modelValue == props.name;
|
|
31
63
|
});
|
|
32
64
|
|
|
33
|
-
//
|
|
34
|
-
const cmpRootStyle = computed(() => {
|
|
35
|
-
const textSize = getDefaultData('textSize', 28);
|
|
36
|
-
const textPosition = getDefaultData('textPosition', 'right');
|
|
37
|
-
const readonly = getDefaultData('readonly', false);
|
|
38
|
-
const disabled = getDefaultData('disabled', false);
|
|
39
|
-
const textDisabled = getDefaultData('textDisabled', false);
|
|
65
|
+
// ─── 根节点样式 ─────────────────────────────────────────────────────────────
|
|
40
66
|
|
|
67
|
+
const cmpRootStyle = computed(() => {
|
|
41
68
|
const style: CSSProperties = {
|
|
42
|
-
fontSize: `var(--font-size-${
|
|
43
|
-
color: cmpChecked.value ?
|
|
44
|
-
flexDirection:
|
|
45
|
-
marginLeft: utils.formatPx(
|
|
46
|
-
marginRight: utils.formatPx(
|
|
47
|
-
columnGap: utils.formatPx(
|
|
69
|
+
fontSize: `var(--font-size-${cmpTextSize.value},${utils.formatPx(cmpTextSize.value)})`,
|
|
70
|
+
color: cmpChecked.value ? cmpTextActiveColor.value : cmpTextInactiveColor.value,
|
|
71
|
+
flexDirection: cmpTextPosition.value === 'right' ? 'row' : 'row-reverse',
|
|
72
|
+
marginLeft: utils.formatPx(cmpMarginLeft.value),
|
|
73
|
+
marginRight: utils.formatPx(cmpMarginRight.value),
|
|
74
|
+
columnGap: slots.default ? utils.formatPx(cmpColumnGap.value) : '0',
|
|
48
75
|
};
|
|
49
76
|
|
|
50
77
|
// #ifdef H5
|
|
51
|
-
if (
|
|
78
|
+
if (cmpDisabled.value || cmpReadonly.value) {
|
|
52
79
|
style['cursor'] = 'not-allowed';
|
|
53
|
-
} else if (
|
|
80
|
+
} else if (cmpTextDisabled.value) {
|
|
54
81
|
style['cursor'] = 'default';
|
|
55
82
|
} else {
|
|
56
83
|
style['cursor'] = 'pointer';
|
|
57
84
|
}
|
|
58
85
|
// #endif
|
|
59
86
|
|
|
60
|
-
if (
|
|
87
|
+
if (cmpTextDisabled.value) {
|
|
61
88
|
style['pointerEvents'] = 'none';
|
|
62
89
|
}
|
|
63
90
|
return style;
|
|
64
91
|
});
|
|
65
92
|
|
|
66
|
-
|
|
67
|
-
const shape = getDefaultData('shape', 'circle');
|
|
68
|
-
const iconSize = getDefaultData('iconSize', 36);
|
|
69
|
-
const checkedColor = getDefaultData('checkedColor', themeColor);
|
|
70
|
-
const readonly = getDefaultData('readonly', false);
|
|
71
|
-
const disabled = getDefaultData('disabled', false);
|
|
72
|
-
const checked = cmpChecked.value;
|
|
93
|
+
// ─── 图标样式 ───────────────────────────────────────────────────────────────
|
|
73
94
|
|
|
95
|
+
const cmpInputStyle = computed(() => {
|
|
74
96
|
const style: CSSProperties = {
|
|
75
|
-
borderRadius:
|
|
76
|
-
border: `${utils.formatPx(2)} solid ${
|
|
77
|
-
background:
|
|
78
|
-
width: `var(--font-size-${
|
|
79
|
-
height: `var(--font-size-${
|
|
80
|
-
lineHeight: `var(--font-size-${
|
|
97
|
+
borderRadius: cmpShape.value === 'circle' ? '50%' : '0',
|
|
98
|
+
border: `${utils.formatPx(2)} solid ${cmpChecked.value ? cmpCheckedColor.value : '#BBBBBB'}`,
|
|
99
|
+
background: cmpChecked.value ? cmpCheckedColor.value : '#FFFFFF',
|
|
100
|
+
width: `var(--font-size-${cmpIconSize.value},${utils.formatPx(cmpIconSize.value)})`,
|
|
101
|
+
height: `var(--font-size-${cmpIconSize.value},${utils.formatPx(cmpIconSize.value)})`,
|
|
102
|
+
lineHeight: `var(--font-size-${cmpIconSize.value},${utils.formatPx(cmpIconSize.value)})`,
|
|
81
103
|
};
|
|
82
104
|
|
|
83
105
|
// #ifdef H5
|
|
84
|
-
style['cursor'] =
|
|
106
|
+
style['cursor'] = cmpDisabled.value || cmpReadonly.value ? 'not-allowed' : 'pointer';
|
|
85
107
|
// #endif
|
|
86
108
|
|
|
87
|
-
if (
|
|
109
|
+
if (cmpDisabled.value) {
|
|
88
110
|
style['background'] = '#eeeeee';
|
|
89
111
|
style['borderColor'] = '#bbbbbb';
|
|
90
112
|
}
|
|
91
|
-
|
|
92
|
-
// 在没有使用插槽内容时去掉边距
|
|
93
|
-
if (!slots.default) {
|
|
94
|
-
style['columnGap'] = '0';
|
|
95
|
-
}
|
|
96
113
|
return style;
|
|
97
114
|
});
|
|
98
115
|
|
|
99
|
-
//
|
|
116
|
+
// ─── slotProps & icon props ─────────────────────────────────────────────────
|
|
117
|
+
|
|
100
118
|
const cmpSlotProps = computed(() => ({
|
|
101
119
|
checked: cmpChecked.value,
|
|
102
|
-
disabled:
|
|
103
|
-
readonly:
|
|
120
|
+
disabled: cmpDisabled.value,
|
|
121
|
+
readonly: cmpReadonly.value,
|
|
104
122
|
}));
|
|
105
123
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return {
|
|
111
|
-
size: iconSize * 0.8,
|
|
112
|
-
color: disabled ? '#bbbbbb' : '#fff',
|
|
113
|
-
};
|
|
114
|
-
});
|
|
124
|
+
const cmpIconProps = computed(() => ({
|
|
125
|
+
size: (cmpIconSize.value as number) * 0.8,
|
|
126
|
+
color: cmpDisabled.value ? '#bbbbbb' : '#fff',
|
|
127
|
+
}));
|
|
115
128
|
|
|
116
|
-
|
|
117
|
-
const readonly = getDefaultData('readonly', false);
|
|
118
|
-
const disabled = getDefaultData('disabled', false);
|
|
119
|
-
|
|
120
|
-
if (!disabled && !readonly) {
|
|
121
|
-
let next = true;
|
|
122
|
-
const stop = new Promise((resolve, reject) => {
|
|
123
|
-
emits(
|
|
124
|
-
'click',
|
|
125
|
-
props.modelValue,
|
|
126
|
-
() => (next = false),
|
|
127
|
-
() => resolve(props.modelValue),
|
|
128
|
-
() => reject()
|
|
129
|
-
);
|
|
130
|
-
});
|
|
131
|
-
if (!next) {
|
|
132
|
-
try {
|
|
133
|
-
await stop;
|
|
134
|
-
} catch (e) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
129
|
+
// ─── 点击处理 ───────────────────────────────────────────────────────────────
|
|
138
130
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
131
|
+
// 🚀 优化: 移除 async,简化 Promise 处理
|
|
132
|
+
function click() {
|
|
133
|
+
if (cmpDisabled.value || cmpReadonly.value) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
let next = true;
|
|
138
|
+
const stop = new Promise<void>(resolve => {
|
|
139
|
+
emits(
|
|
140
|
+
'click',
|
|
141
|
+
props.modelValue,
|
|
142
|
+
() => (next = false),
|
|
143
|
+
() => resolve(),
|
|
144
|
+
() => {}
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
if (!next) {
|
|
149
|
+
stop.catch(() => {});
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (!cmpChecked.value) {
|
|
154
|
+
let value = String(props.name);
|
|
155
|
+
if (inGroup.value) {
|
|
156
|
+
parentData.value!.updateValue(value);
|
|
157
|
+
} else {
|
|
158
|
+
emits('update:modelValue', value);
|
|
147
159
|
}
|
|
160
|
+
emits('change', value);
|
|
148
161
|
}
|
|
149
162
|
}
|
|
150
163
|
|
|
164
|
+
// ─── 工具函数(保留兼容)──────────────────────────────────────────────────────
|
|
165
|
+
|
|
151
166
|
type PropsKeyType = keyof typeof props;
|
|
167
|
+
/**
|
|
168
|
+
* 优先使用子组件自身 prop,否则读父组件 props,最后取默认值。
|
|
169
|
+
* 每个独立 computed 调用此函数,响应式系统会精准追踪对应字段。
|
|
170
|
+
*/
|
|
152
171
|
const getDefaultData = <T,>(key: PropsKeyType, defaultValue: T): T => {
|
|
153
172
|
const value = props[key];
|
|
154
|
-
|
|
173
|
+
if (value !== undefined && value !== null && value !== '') return value as T;
|
|
174
|
+
const parentVal = parentProps.value?.[key as keyof RadioGroupProps];
|
|
175
|
+
if (parentVal !== undefined && parentVal !== null && (parentVal as any) !== '') return parentVal as T;
|
|
176
|
+
return defaultValue;
|
|
155
177
|
};
|
|
156
178
|
</script>
|
|
157
179
|
|
|
@@ -165,10 +187,12 @@ const getDefaultData = <T,>(key: PropsKeyType, defaultValue: T): T => {
|
|
|
165
187
|
</slot>
|
|
166
188
|
</view>
|
|
167
189
|
<view class="text">
|
|
190
|
+
<!-- #ifndef MP -->
|
|
191
|
+
<slot :slotProps="cmpSlotProps"></slot>
|
|
192
|
+
<!-- #endif -->
|
|
168
193
|
<!-- #ifdef MP -->
|
|
169
194
|
<slot></slot>
|
|
170
195
|
<!-- #endif -->
|
|
171
|
-
<slot :slotProps="cmpSlotProps"></slot>
|
|
172
196
|
</view>
|
|
173
197
|
</view>
|
|
174
198
|
</template>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
6
|
| `modelValue` | 当前评分数(支持v-model双向绑定) | `Number` | `0` | - | - |
|
|
@@ -15,7 +17,9 @@
|
|
|
15
17
|
| `iconData` | 每个分值对应的图标code | `Array` | `() => []` | - | - |
|
|
16
18
|
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
### Events
|
|
19
21
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
20
22
|
| ----- | ----- | ------- | -------- |
|
|
21
|
-
| `change` | 当前分值变化时触发的事件 |
|
|
23
|
+
| `change` | 当前分值变化时触发的事件 | `data`:() => void | - |
|
|
24
|
+
|
|
25
|
+
|