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
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
|
-
| `show` |
|
|
5
|
-
| `type` |
|
|
6
|
-
| `loop` |
|
|
6
|
+
| `show` | 控制动画,当值从false变为true时会触发一次动画 | `boolean` | `false` | - | - |
|
|
7
|
+
| `type` | 动画类型 | `string` | `` | `shake`:抖动,建议 loop 为 true<br/>`shakeX`:横向抖动,建议 loop 为 true<br/>`shakeY`:竖向抖动,建议 loop 为 true<br/>`ripple`:不循环则是放大后缩小,循环则是心跳<br/>`breath`:呼吸灯,建议 loop 为 true<br/>`float`:漂浮,建议 loop 为 true<br/>`slide-right`:由右向左划入<br/>`slide-left`:由左向右划入<br/>`slide-top`:由上至下划入<br/>`slide-bottom`:由下至上划入<br/>`jump`:跳跃,建议 loop 为 true<br/>`twinkle`:水波,建议 loop 为 true<br/>`flicker`:擦亮按钮,建议 loop 为 true | - |
|
|
8
|
+
| `loop` | 是否循环执行 | `boolean` | `false` | - | - |
|
|
7
9
|
| `duration` | 动画时长,单位 ms | `number` | `200` | - | - |
|
|
8
|
-
| `action` |
|
|
10
|
+
| `action` | 触发方式,不能与 show 同时使用 | `string` | `` | `initial`:初始化执行<br/>`click`:点击执行 | - |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Slots
|
|
14
|
+
| 插槽名 | 说明 | 参数 | 支持版本 |
|
|
15
|
+
| ----- | ----- | --- | -------- |
|
|
16
|
+
| `default` | 默认插槽 | - | - |
|
|
9
17
|
|
|
10
18
|
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 代码演示
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 基础使用
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<template>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
## 点击触发
|
|
41
41
|
|
|
42
42
|
设置`action`为`click`
|
|
43
43
|
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
</template>
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
## 属性触发
|
|
62
62
|
|
|
63
63
|
可通过属性`show`来自定义触发动画执行
|
|
64
64
|
|
|
@@ -88,32 +88,8 @@
|
|
|
88
88
|
|
|
89
89
|
---$
|
|
90
90
|
|
|
91
|
-
### API
|
|
92
|
-
|
|
93
91
|
<!-- props -->
|
|
94
92
|
|
|
95
|
-
#### 动画类型(type)
|
|
96
|
-
|
|
97
|
-
| 参数名称 | 参数说明 |
|
|
98
|
-
| -------------- | ---------------------------------- |
|
|
99
|
-
| `shake` | 抖动,建议 loop 为 true |
|
|
100
|
-
| `ripple` | 不循环则是放大后缩小,循环则是心跳 |
|
|
101
|
-
| `breath` | 呼吸灯,建议 loop 为 true |
|
|
102
|
-
| `float` | 漂浮,建议 loop 为 true |
|
|
103
|
-
| `slide-right` | 由右向左划入 |
|
|
104
|
-
| `slide-left` | 由左向右划入 |
|
|
105
|
-
| `slide-top` | 由上至下划入 |
|
|
106
|
-
| `slide-bottom` | 由下至上划入 |
|
|
107
|
-
| `jump` | 跳跃,建议 loop 为 true |
|
|
108
|
-
| `twinkle` | 水波,建议 loop 为 true |
|
|
109
|
-
| `flicker` | 擦亮按钮,建议 loop 为 true |
|
|
110
|
-
|
|
111
|
-
#### 组件插槽(Slots)
|
|
112
|
-
|
|
113
|
-
| 名称 | 说明 | 支持版本 |
|
|
114
|
-
| --------- | -------- | -------- |
|
|
115
|
-
| `default` | 默认插槽 | - |
|
|
116
|
-
|
|
117
93
|
---$
|
|
118
94
|
|
|
119
95
|
{{fuyuwei}}
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ste-animate",
|
|
3
|
-
"description": "
|
|
4
|
-
"example": "<ste-animate></ste-animate>",
|
|
3
|
+
"description": "动画组件,给子元素添加动画效果",
|
|
4
|
+
"example": "<ste-animate type=\"shakeX\" loop><ste-button>抖动</ste-button></ste-animate>",
|
|
5
5
|
"tutorial": "https://stellar-ui.intecloud.com.cn/?projectName=stellar-ui-plus&menu=%E7%BB%84%E4%BB%B6&active=ste-animate",
|
|
6
6
|
"attributes": [
|
|
7
7
|
{
|
|
8
8
|
"name": "show",
|
|
9
|
-
"description": "
|
|
9
|
+
"description": "控制动画,当值从false变为true时会触发一次动画",
|
|
10
10
|
"type": "boolean",
|
|
11
|
-
|
|
12
11
|
"default": false
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
14
|
"name": "type",
|
|
16
|
-
"description": "
|
|
15
|
+
"description": "动画类型",
|
|
17
16
|
"type": "string",
|
|
18
|
-
"default": ""
|
|
17
|
+
"default": "",
|
|
18
|
+
"values": [
|
|
19
|
+
{ "name": "shake", "description": "抖动,建议 loop 为 true" },
|
|
20
|
+
{ "name": "shakeX", "description": "横向抖动,建议 loop 为 true" },
|
|
21
|
+
{ "name": "shakeY", "description": "竖向抖动,建议 loop 为 true" },
|
|
22
|
+
{ "name": "ripple", "description": "不循环则是放大后缩小,循环则是心跳" },
|
|
23
|
+
{ "name": "breath", "description": "呼吸灯,建议 loop 为 true" },
|
|
24
|
+
{ "name": "float", "description": "漂浮,建议 loop 为 true" },
|
|
25
|
+
{ "name": "slide-right", "description": "由右向左划入" },
|
|
26
|
+
{ "name": "slide-left", "description": "由左向右划入" },
|
|
27
|
+
{ "name": "slide-top", "description": "由上至下划入" },
|
|
28
|
+
{ "name": "slide-bottom", "description": "由下至上划入" },
|
|
29
|
+
{ "name": "jump", "description": "跳跃,建议 loop 为 true" },
|
|
30
|
+
{ "name": "twinkle", "description": "水波,建议 loop 为 true" },
|
|
31
|
+
{ "name": "flicker", "description": "擦亮按钮,建议 loop 为 true" }
|
|
32
|
+
]
|
|
19
33
|
},
|
|
20
34
|
{
|
|
21
35
|
"name": "loop",
|
|
22
|
-
"description": "
|
|
36
|
+
"description": "是否循环执行",
|
|
23
37
|
"type": "boolean",
|
|
24
38
|
"default": false
|
|
25
39
|
},
|
|
@@ -31,9 +45,17 @@
|
|
|
31
45
|
},
|
|
32
46
|
{
|
|
33
47
|
"name": "action",
|
|
34
|
-
"description": "
|
|
48
|
+
"description": "触发方式,不能与 show 同时使用",
|
|
35
49
|
"type": "string",
|
|
36
|
-
"default": ""
|
|
50
|
+
"default": "",
|
|
51
|
+
"values": [
|
|
52
|
+
{ "name": "initial", "description": "初始化执行" },
|
|
53
|
+
{ "name": "click", "description": "点击执行" }
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "[slot]default",
|
|
58
|
+
"description": "默认插槽"
|
|
37
59
|
}
|
|
38
60
|
]
|
|
39
61
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
6
|
| `clientId` | 应用编码 | `string` | `` | - | - |
|
|
@@ -8,11 +10,15 @@
|
|
|
8
10
|
| `btnText` | 立即体验按钮文本 | `string` | `立即体验` | - | - |
|
|
9
11
|
| `appVersion` | 当前应用版本 | `string` | `` | - | `1.24.6` |
|
|
10
12
|
| `zIndex` | 弹窗层级 | `string/number` | `998` | - | `1.24.23` |
|
|
13
|
+
| `fallbackApiUrl` | 兜底检查接口地址 | `string` | `` | - | - |
|
|
11
14
|
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
### Events
|
|
14
17
|
| 事件名 | 说明 | 事件参数 | 支持版本 |
|
|
15
18
|
| ----- | ----- | ------- | -------- |
|
|
16
|
-
| `cancel` |
|
|
17
|
-
| `update` |
|
|
18
|
-
| `no-update` |
|
|
19
|
+
| `cancel` | 取消更新时触发 | - | - |
|
|
20
|
+
| `update` | 发现新版本时触发 | - | - |
|
|
21
|
+
| `no-update` | 没有新版本时触发 | - | - |
|
|
22
|
+
| `fallback` | 命中兜底更新时触发 | `data`:兜底更新数据,包含 title、description、downloadUrl | - |
|
|
23
|
+
|
|
24
|
+
|
|
@@ -144,4 +144,47 @@ export function download(
|
|
|
144
144
|
}, 300000);
|
|
145
145
|
|
|
146
146
|
return downloadTask;
|
|
147
|
-
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// 获取设备唯一标识
|
|
150
|
+
export const getDeviceId = (): string => {
|
|
151
|
+
// #ifdef APP-PLUS
|
|
152
|
+
return plus.device.uuid || '';
|
|
153
|
+
// #endif
|
|
154
|
+
// #ifndef APP-PLUS
|
|
155
|
+
return '';
|
|
156
|
+
// #endif
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// 获取当前平台
|
|
160
|
+
export const getPlatform = (): string => {
|
|
161
|
+
// #ifdef APP-PLUS
|
|
162
|
+
return plus.os.name?.toLowerCase() || 'android';
|
|
163
|
+
// #endif
|
|
164
|
+
// #ifndef APP-PLUS
|
|
165
|
+
return 'unknown';
|
|
166
|
+
// #endif
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// 获取APPID
|
|
170
|
+
export const getAppId = (): string => {
|
|
171
|
+
// #ifdef APP-PLUS
|
|
172
|
+
return plus.runtime.appid || '';
|
|
173
|
+
// #endif
|
|
174
|
+
// #ifndef APP-PLUS
|
|
175
|
+
return '';
|
|
176
|
+
// #endif
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// 获取当前版本号
|
|
180
|
+
export const getVersion = (appVersion: string): Promise<string> => {
|
|
181
|
+
return new Promise(resolve => {
|
|
182
|
+
if (appVersion) {
|
|
183
|
+
resolve(appVersion);
|
|
184
|
+
} else {
|
|
185
|
+
plus.runtime.getProperty(plus.runtime.appid || '', inf => {
|
|
186
|
+
resolve(inf.version || '');
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
};
|
|
@@ -7,6 +7,7 @@ export interface AppUpdateProps {
|
|
|
7
7
|
btnText: string;
|
|
8
8
|
appVersion: string;
|
|
9
9
|
zIndex: number;
|
|
10
|
+
fallbackApiUrl: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export default {
|
|
@@ -64,7 +65,21 @@ export default {
|
|
|
64
65
|
type: [Number, String],
|
|
65
66
|
default: () => 998,
|
|
66
67
|
validator: (value: any) => {
|
|
67
|
-
return typeof value === 'number' || typeof value === 'string'
|
|
68
|
-
}
|
|
68
|
+
return typeof value === 'number' || typeof value === 'string'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
fallbackApiUrl: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'https://stellar-public-prd.intecloud.com.cn/api/app-update/check',
|
|
74
|
+
validator: (value: string) => {
|
|
75
|
+
if (value === '') return true;
|
|
76
|
+
if (typeof value !== 'string') return false;
|
|
77
|
+
try {
|
|
78
|
+
new URL(value);
|
|
79
|
+
return true;
|
|
80
|
+
} catch {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
69
84
|
},
|
|
70
85
|
} satisfies Record<keyof AppUpdateProps, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ste-app-update",
|
|
3
|
-
"description": "
|
|
4
|
-
"example": "<ste-app-update></ste-app-update>",
|
|
3
|
+
"description": "应用更新组件,用于检测和提示APP版本更新",
|
|
4
|
+
"example": "<ste-app-update clientId=\"your-client-id\" clientSecret=\"your-client-secret\"></ste-app-update>",
|
|
5
5
|
"tutorial": "https://stellar-ui.intecloud.com.cn/?projectName=stellar-ui-plus&menu=%E7%BB%84%E4%BB%B6&active=ste-app-update",
|
|
6
6
|
"attributes": [
|
|
7
7
|
{
|
|
@@ -48,20 +48,30 @@
|
|
|
48
48
|
"default": "998",
|
|
49
49
|
"version": "1.24.23"
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
"name": "fallbackApiUrl",
|
|
53
|
+
"description": "兜底检查接口地址",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"default": ""
|
|
56
|
+
},
|
|
51
57
|
{
|
|
52
58
|
"name": "[event]cancel",
|
|
53
|
-
"description": "
|
|
54
|
-
"type": "() => void"
|
|
59
|
+
"description": "取消更新时触发"
|
|
55
60
|
},
|
|
56
61
|
{
|
|
57
62
|
"name": "[event]update",
|
|
58
|
-
"description": "
|
|
59
|
-
"type": "() => void"
|
|
63
|
+
"description": "发现新版本时触发"
|
|
60
64
|
},
|
|
61
65
|
{
|
|
62
66
|
"name": "[event]no-update",
|
|
63
|
-
"description": "
|
|
64
|
-
|
|
67
|
+
"description": "没有新版本时触发"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "[event]fallback",
|
|
71
|
+
"description": "命中兜底更新时触发",
|
|
72
|
+
"params": [
|
|
73
|
+
{ "name": "data", "description": "兜底更新数据,包含 title、description、downloadUrl" }
|
|
74
|
+
]
|
|
65
75
|
}
|
|
66
76
|
]
|
|
67
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, reactive, onUnmounted } from 'vue';
|
|
3
3
|
import propsData from './props';
|
|
4
|
-
import { type ClientData, type ResponseData, download as downloadMethod } from './method';
|
|
4
|
+
import { type ClientData, type ResponseData, download as downloadMethod, getAppId, getDeviceId, getPlatform, getVersion } from './method';
|
|
5
5
|
|
|
6
6
|
// 类型定义
|
|
7
7
|
interface AppUpdateData extends ClientData {
|
|
@@ -34,16 +34,31 @@ const tempFilePath = ref('');
|
|
|
34
34
|
|
|
35
35
|
// 资源管理
|
|
36
36
|
let timeoutTimer: ReturnType<typeof setTimeout> | null = null;
|
|
37
|
+
let downloadTask: UniApp.DownloadTask | null = null;
|
|
37
38
|
|
|
38
39
|
// 跳过版本相关
|
|
39
40
|
const skippedVersions = ref<string[]>([]);
|
|
40
41
|
const STORAGE_KEY = 'skipped_app_versions';
|
|
41
42
|
|
|
43
|
+
// 兜底更新相关
|
|
44
|
+
|
|
45
|
+
// 兜底检查接口返回类型
|
|
46
|
+
interface FallbackCheckResponse {
|
|
47
|
+
code: number;
|
|
48
|
+
message: string;
|
|
49
|
+
data: {
|
|
50
|
+
title: string;
|
|
51
|
+
description: string;
|
|
52
|
+
downloadUrl: string;
|
|
53
|
+
} | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
42
56
|
const emits = defineEmits<{
|
|
43
57
|
(e: 'cancel'): void;
|
|
44
58
|
(e: 'update'): void;
|
|
45
59
|
(e: 'no-update'): void;
|
|
46
60
|
(e: 'skip-version', version: string): void;
|
|
61
|
+
(e: 'fallback', data: { title: string; description: string; downloadUrl: string }): void;
|
|
47
62
|
}>();
|
|
48
63
|
|
|
49
64
|
// 初始化跳过版本列表
|
|
@@ -93,6 +108,7 @@ const cleanup = () => {
|
|
|
93
108
|
clearTimeout(timeoutTimer);
|
|
94
109
|
timeoutTimer = null;
|
|
95
110
|
}
|
|
111
|
+
downloadTask = null;
|
|
96
112
|
};
|
|
97
113
|
|
|
98
114
|
// 组件卸载时清理资源
|
|
@@ -196,25 +212,80 @@ const getData = (callback?: (resVersion: { name: string; code: string; updateFil
|
|
|
196
212
|
});
|
|
197
213
|
};
|
|
198
214
|
|
|
199
|
-
|
|
215
|
+
// 兜底检查:上报版本 + 检查是否命中兜底配置
|
|
216
|
+
const checkFallback = (): Promise<boolean> => {
|
|
217
|
+
return new Promise(resolve => {
|
|
218
|
+
if (!props.fallbackApiUrl) {
|
|
219
|
+
resolve(false);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const data = {
|
|
223
|
+
appId: getAppId(), // 优先用配置的 appId(业务包名),fallback 到系统 appid
|
|
224
|
+
deviceId: getDeviceId(),
|
|
225
|
+
versionCode: parseInt(version.value) || 0,
|
|
226
|
+
versionName: version.value, // 版本名称,兜底触发的主要依据
|
|
227
|
+
platform: getPlatform(),
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
uni.request({
|
|
231
|
+
url: props.fallbackApiUrl,
|
|
232
|
+
method: 'POST',
|
|
233
|
+
header: { 'Content-Type': 'application/json' },
|
|
234
|
+
data,
|
|
235
|
+
timeout: 1000,
|
|
236
|
+
success: (res: any) => {
|
|
237
|
+
try {
|
|
238
|
+
const resp = res.data as FallbackCheckResponse;
|
|
239
|
+
// 明确返回 data 且有 downloadUrl 才触发兜底
|
|
240
|
+
if (resp && resp.code === 0 && resp.data && resp.data.downloadUrl) {
|
|
241
|
+
emits('fallback', resp.data);
|
|
242
|
+
uni.showModal({
|
|
243
|
+
title: resp.data.title || '发现新版本',
|
|
244
|
+
content: resp.data.description || '当前版本可能存在兼容性问题,建议您前往浏览器下载最新版本。',
|
|
245
|
+
confirmText: '前往下载',
|
|
246
|
+
showCancel: true,
|
|
247
|
+
cancelText: '暂不更新',
|
|
248
|
+
success: modalRes => {
|
|
249
|
+
if (modalRes.confirm) {
|
|
250
|
+
// #ifdef APP-PLUS
|
|
251
|
+
plus.runtime.openURL(resp.data!.downloadUrl);
|
|
252
|
+
// #endif
|
|
253
|
+
// #ifndef H5
|
|
254
|
+
window.open(resp.data!.downloadUrl, '_blank');
|
|
255
|
+
// #endif
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
resolve(true);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
} catch (e) {
|
|
263
|
+
console.warn('兜底检查响应解析失败:', e);
|
|
264
|
+
}
|
|
265
|
+
// 接口失败或未命中兜底 → 走正常更新流程
|
|
266
|
+
resolve(false);
|
|
267
|
+
},
|
|
268
|
+
fail: () => {
|
|
269
|
+
// 接口失败 → 降级走正常更新流程
|
|
270
|
+
resolve(false);
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
});
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
const start = async (callback?: (resVersion: { name: string; code: string; updateFile: string }, version: string) => void) => {
|
|
200
277
|
// 初始化跳过版本记录
|
|
201
278
|
initSkippedVersions();
|
|
202
279
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
// #endif
|
|
212
|
-
// #ifndef APP-PLUS
|
|
213
|
-
if (props.appVersion) {
|
|
214
|
-
version.value = props.appVersion;
|
|
215
|
-
}
|
|
280
|
+
const v = await getVersion(props.appVersion);
|
|
281
|
+
if (v) version.value = v;
|
|
282
|
+
|
|
283
|
+
// 兜底检查:如果配置了 fallbackApiUrl,先调兜底接口
|
|
284
|
+
const hit = await checkFallback();
|
|
285
|
+
if (hit) return; // 命中兜底,不继续正常流程
|
|
286
|
+
|
|
287
|
+
// 正常更新流程
|
|
216
288
|
getData(callback);
|
|
217
|
-
// #endif
|
|
218
289
|
};
|
|
219
290
|
|
|
220
291
|
const onProgressUpdate = (res: UniApp.OnProgressDownloadResult) => {
|
|
@@ -239,7 +310,7 @@ const confirm = () => {
|
|
|
239
310
|
if (data.package_type == 0) {
|
|
240
311
|
if (data.updateFile.includes('.apk')) {
|
|
241
312
|
updateBtn.value = false;
|
|
242
|
-
downloadMethod(data, {
|
|
313
|
+
downloadTask = downloadMethod(data, {
|
|
243
314
|
onProgressUpdate,
|
|
244
315
|
downloadSuccess: path => (tempFilePath.value = path),
|
|
245
316
|
error: () => {
|
|
@@ -258,7 +329,7 @@ const confirm = () => {
|
|
|
258
329
|
}
|
|
259
330
|
} else {
|
|
260
331
|
updateBtn.value = false;
|
|
261
|
-
downloadMethod(data, {
|
|
332
|
+
downloadTask = downloadMethod(data, {
|
|
262
333
|
onProgressUpdate,
|
|
263
334
|
downloadSuccess: path => (tempFilePath.value = path),
|
|
264
335
|
error: () => {
|
|
@@ -317,6 +388,10 @@ const cancelDownload = () => {
|
|
|
317
388
|
content: '确定要取消下载吗?',
|
|
318
389
|
success: res => {
|
|
319
390
|
if (res.confirm) {
|
|
391
|
+
// 取消下载时才 abort 下载任务
|
|
392
|
+
if (downloadTask) {
|
|
393
|
+
downloadTask.abort();
|
|
394
|
+
}
|
|
320
395
|
cleanup();
|
|
321
396
|
updateBtn.value = true;
|
|
322
397
|
percent.value = 0;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
---$
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 代码演示
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 默认配置
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<template>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
</script>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## 默认颜色
|
|
34
34
|
|
|
35
35
|
- 属性`color`: `['#165DFF', '#14C9C9', '#F7BA1E', '#3491FA', '#F53F3F']`
|
|
36
36
|
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
</script>
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
## 区域图类型
|
|
72
72
|
|
|
73
73
|
- 属性`type`: 区域图类型
|
|
74
74
|
- `straight`: 尖角折线模式(默认)
|
|
@@ -99,6 +99,23 @@
|
|
|
99
99
|
</script>
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
+
## 事件
|
|
103
|
+
|
|
104
|
+
- 属性`getImage`: 通过ref来获取实例的base64格式的图片地址,异步方法,需在实例生成后调用。
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<template>
|
|
108
|
+
<ste-area-chart :series="series1" :categories1="categories1" ref="areaChart"></ste-area-chart>
|
|
109
|
+
</template>
|
|
110
|
+
<script setup lang="ts">
|
|
111
|
+
import { ref,onMounted } from 'vue';
|
|
112
|
+
let areaChart: any = ref(null);
|
|
113
|
+
onMounted(async () => {
|
|
114
|
+
const base64 = await areaChart.value.getImage()
|
|
115
|
+
}),
|
|
116
|
+
</script>
|
|
117
|
+
```
|
|
118
|
+
|
|
102
119
|
---$
|
|
103
120
|
|
|
104
121
|
<!-- props -->
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
8
|
import uCharts from '../../Charts/Charts';
|
|
9
|
-
import { ref, onMounted, computed, type CSSProperties, watch, getCurrentInstance } from 'vue';
|
|
9
|
+
import { ref, onMounted, computed, type CSSProperties, watch, getCurrentInstance, type ComponentPublicInstance } from 'vue';
|
|
10
10
|
import utils from '../../utils/utils';
|
|
11
11
|
import { propsData, propsComponent } from './props';
|
|
12
12
|
import type { ChartsOptions } from '../../Charts/types/index';
|
|
@@ -99,6 +99,38 @@ function tap(e: any) {
|
|
|
99
99
|
charts.value?.touchLegend(e);
|
|
100
100
|
charts.value?.showToolTip(e);
|
|
101
101
|
}
|
|
102
|
+
const thas = ref<ComponentPublicInstance | null>();
|
|
103
|
+
async function getImage() {
|
|
104
|
+
if (props.canvas2d == false) {
|
|
105
|
+
return new Promise(resolve => {
|
|
106
|
+
uni.canvasToTempFilePath(
|
|
107
|
+
{
|
|
108
|
+
canvasId: canvasId.value,
|
|
109
|
+
success: res => {
|
|
110
|
+
resolve(res.tempFilePath);
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
thas.value
|
|
114
|
+
);
|
|
115
|
+
});
|
|
116
|
+
} else {
|
|
117
|
+
return new Promise(resolve => {
|
|
118
|
+
const query = uni.createSelectorQuery().in(thas.value);
|
|
119
|
+
query
|
|
120
|
+
.select('#' + canvasId.value)
|
|
121
|
+
.fields({ node: true, size: true })
|
|
122
|
+
.exec(res => {
|
|
123
|
+
if (res[0]) {
|
|
124
|
+
const canvas = res[0].node;
|
|
125
|
+
resolve(canvas.toDataURL('image/png'));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
defineExpose({
|
|
132
|
+
getImage,
|
|
133
|
+
});
|
|
102
134
|
</script>
|
|
103
135
|
|
|
104
136
|
<style scoped></style>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## API
|
|
2
|
+
|
|
3
|
+
### Props
|
|
2
4
|
| 属性名 | 说明 | 类型 | 默认值 | 可选值 | 支持版本 |
|
|
3
5
|
| ----- | ----- | --- | ------- | ------ | -------- |
|
|
4
6
|
| `content` | 徽标内容 | `string / number` | - | - | - |
|
|
@@ -15,3 +17,10 @@
|
|
|
15
17
|
| `isInline` | display属性是否为inline-block | `boolean` | `false` | - | - |
|
|
16
18
|
|
|
17
19
|
|
|
20
|
+
### Slots
|
|
21
|
+
| 插槽名 | 说明 | 参数 | 支持版本 |
|
|
22
|
+
| ----- | ----- | --- | -------- |
|
|
23
|
+
| `default` | 默认插槽 | - | - |
|
|
24
|
+
| `content` | 自定义徽标内容 | - | - |
|
|
25
|
+
|
|
26
|
+
|