sard-uniapp 1.19.1 → 1.19.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/CHANGELOG.md +30 -0
- package/components/accordion/README.md +91 -0
- package/components/accordion/accordion.vue +7 -0
- package/components/accordion-item/accordion-item.vue +9 -0
- package/components/action-sheet/README.md +85 -0
- package/components/action-sheet/action-sheet.vue +15 -0
- package/components/action-sheet/variables.scss +1 -1
- package/components/alert/README.md +74 -0
- package/components/alert/alert.vue +10 -0
- package/components/avatar/README.md +86 -0
- package/components/avatar/avatar.vue +8 -0
- package/components/back-top/README.md +134 -0
- package/components/back-top/back-top.vue +9 -0
- package/components/badge/README.md +95 -0
- package/components/badge/badge.vue +11 -0
- package/components/button/README.md +162 -0
- package/components/button/button.vue +46 -0
- package/components/calendar/README.md +94 -0
- package/components/calendar/calendar.vue +21 -2
- package/components/calendar-input/README.md +65 -0
- package/components/calendar-input/calendar-input.d.ts +3 -2
- package/components/calendar-input/calendar-input.vue +32 -0
- package/components/calendar-input/common.d.ts +2 -0
- package/components/calendar-popout/README.md +100 -0
- package/components/calendar-popout/calendar-popout.d.ts +12 -2
- package/components/calendar-popout/calendar-popout.vue +32 -1
- package/components/calendar-popout/common.d.ts +2 -0
- package/components/card/README.md +82 -0
- package/components/card/card.vue +9 -0
- package/components/cascader/README.md +117 -0
- package/components/cascader/cascader.vue +13 -0
- package/components/cascader-input/README.md +51 -0
- package/components/cascader-input/cascader-input.d.ts +2 -1
- package/components/cascader-input/cascader-input.vue +32 -6
- package/components/cascader-input/common.d.ts +2 -0
- package/components/cascader-input/common.js +1 -0
- package/components/cascader-popout/README.md +53 -0
- package/components/cascader-popout/cascader-popout.d.ts +1 -1
- package/components/cascader-popout/cascader-popout.vue +21 -2
- package/components/check-icon/variables.scss +1 -1
- package/components/checkbox/README.md +185 -0
- package/components/checkbox/checkbox.vue +17 -0
- package/components/checkbox/variables.scss +1 -1
- package/components/checkbox-group/checkbox-group.vue +15 -0
- package/components/checkbox-input/README.md +44 -0
- package/components/checkbox-input/checkbox-input.d.ts +1 -0
- package/components/checkbox-input/checkbox-input.vue +25 -2
- package/components/checkbox-input/common.d.ts +2 -0
- package/components/checkbox-input/common.js +5 -1
- package/components/checkbox-popout/README.md +52 -0
- package/components/checkbox-popout/checkbox-popout.vue +19 -0
- package/components/col/col.vue +7 -0
- package/components/collapse/README.md +45 -0
- package/components/collapse/collapse.vue +3 -0
- package/components/config/index.d.ts +46 -1
- package/components/config/index.js +37 -0
- package/components/count-down/README.md +97 -0
- package/components/count-down/count-down.vue +8 -0
- package/components/count-to/README.md +61 -0
- package/components/count-to/count-to.vue +7 -0
- package/components/crop-image/README.md +86 -0
- package/components/crop-image/crop-image.vue +15 -0
- package/components/datetime-picker/README.md +136 -0
- package/components/datetime-picker/datetime-picker.vue +14 -0
- package/components/datetime-picker-input/README.md +82 -0
- package/components/datetime-picker-input/common.d.ts +2 -0
- package/components/datetime-picker-input/common.js +1 -0
- package/components/datetime-picker-input/datetime-picker-input.d.ts +2 -1
- package/components/datetime-picker-input/datetime-picker-input.vue +26 -0
- package/components/datetime-picker-popout/README.md +77 -0
- package/components/datetime-picker-popout/datetime-picker-popout.d.ts +1 -1
- package/components/datetime-picker-popout/datetime-picker-popout.vue +21 -2
- package/components/datetime-range-picker/README.md +49 -0
- package/components/datetime-range-picker/datetime-range-picker.vue +15 -0
- package/components/datetime-range-picker-input/README.md +58 -0
- package/components/datetime-range-picker-input/common.d.ts +2 -0
- package/components/datetime-range-picker-input/common.js +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.d.ts +1 -0
- package/components/datetime-range-picker-input/datetime-range-picker-input.vue +27 -0
- package/components/datetime-range-picker-popout/README.md +53 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +22 -2
- package/components/dialog/README.md +192 -0
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dialog/dialog.vue +33 -0
- package/components/dialog-agent/dialog-agent.d.ts +1 -1
- package/components/dialog-agent/dialog-agent.vue +21 -0
- package/components/divider/README.md +80 -0
- package/components/divider/divider.vue +8 -0
- package/components/dropdown/README.md +168 -0
- package/components/dropdown/common.d.ts +7 -0
- package/components/dropdown/common.js +1 -0
- package/components/dropdown/dropdown.d.ts +1 -1
- package/components/dropdown/dropdown.vue +16 -1
- package/components/dropdown/variables.scss +1 -1
- package/components/dropdown-item/dropdown-item.vue +51 -4
- package/components/empty/README.md +71 -0
- package/components/empty/empty.vue +8 -0
- package/components/empty/variables.scss +1 -1
- package/components/fab/README.md +111 -0
- package/components/fab/fab.vue +18 -0
- package/components/floating-bubble/README.md +70 -0
- package/components/floating-bubble/floating-bubble.vue +11 -0
- package/components/floating-panel/README.md +78 -0
- package/components/floating-panel/floating-panel.vue +11 -0
- package/components/form/README.md +308 -0
- package/components/form/form.vue +19 -0
- package/components/form-item/form-item.vue +17 -0
- package/components/grid/README.md +140 -0
- package/components/grid/grid.vue +11 -0
- package/components/grid-item/grid-item.vue +15 -0
- package/components/icon/README.md +118 -0
- package/components/icon/common.d.ts +2 -0
- package/components/icon/icon.d.ts +1 -0
- package/components/icon/icon.vue +18 -3
- package/components/indexes/README.md +83 -0
- package/components/indexes/indexes.vue +7 -0
- package/components/indexes-anchor/indexes-anchor.vue +5 -0
- package/components/input/README.md +170 -0
- package/components/input/common.d.ts +1 -0
- package/components/input/index.scss +0 -20
- package/components/input/input.vue +71 -17
- package/components/input/variables.scss +2 -2
- package/components/keyboard/README.md +82 -0
- package/components/keyboard/keyboard.vue +7 -0
- package/components/layout/README.md +89 -0
- package/components/list/README.md +118 -0
- package/components/list/list.vue +8 -0
- package/components/list-item/list-item.vue +15 -0
- package/components/load-more/README.md +75 -0
- package/components/load-more/load-more.vue +11 -0
- package/components/loading/README.md +89 -0
- package/components/loading/loading.vue +13 -0
- package/components/lucky-draw/README.md +174 -0
- package/components/marquee/README.md +65 -0
- package/components/marquee/marquee.vue +7 -0
- package/components/menu/_README.md +61 -0
- package/components/navbar/README.md +123 -0
- package/components/navbar/navbar.vue +11 -0
- package/components/navbar-item/navbar-item.vue +10 -0
- package/components/notice-bar/README.md +135 -0
- package/components/notice-bar/notice-bar.vue +17 -0
- package/components/notify/README.md +118 -0
- package/components/notify/notify.vue +11 -0
- package/components/notify-agent/notify-agent.vue +12 -0
- package/components/overlay/README.md +56 -0
- package/components/overlay/overlay.vue +10 -0
- package/components/pagination/README.md +80 -0
- package/components/pagination/pagination.vue +15 -0
- package/components/password-input/README.md +87 -0
- package/components/password-input/password-input.vue +17 -0
- package/components/picker/README.md +115 -0
- package/components/picker/common.d.ts +1 -1
- package/components/picker/common.js +18 -6
- package/components/picker/picker.vue +40 -15
- package/components/picker-input/README.md +51 -0
- package/components/picker-input/common.d.ts +2 -0
- package/components/picker-input/common.js +2 -0
- package/components/picker-input/picker-input.d.ts +2 -1
- package/components/picker-input/picker-input.vue +24 -2
- package/components/picker-popout/README.md +51 -0
- package/components/picker-popout/picker-popout.d.ts +1 -1
- package/components/picker-popout/picker-popout.vue +24 -4
- package/components/popout/README.md +111 -0
- package/components/popout/common.d.ts +1 -0
- package/components/popout/popout.d.ts +1 -1
- package/components/popout/popout.vue +30 -0
- package/components/popout-input/README.md +55 -0
- package/components/popout-input/popout-input.vue +16 -0
- package/components/popout-input/variables.scss +1 -1
- package/components/popover/README.md +191 -0
- package/components/popover/popover.vue +15 -0
- package/components/popover-reference/popover-reference.vue +5 -0
- package/components/popup/README.md +67 -0
- package/components/popup/popup.vue +20 -0
- package/components/progress-bar/README.md +90 -0
- package/components/progress-bar/progress-bar.vue +13 -0
- package/components/progress-circle/README.md +75 -0
- package/components/progress-circle/progress-circle.vue +10 -0
- package/components/pull-down-refresh/README.md +100 -0
- package/components/pull-down-refresh/pull-down-refresh.d.ts +1 -1
- package/components/pull-down-refresh/pull-down-refresh.vue +11 -0
- package/components/qrcode/README.md +103 -0
- package/components/qrcode/common.d.ts +2 -0
- package/components/qrcode/qrcode.vue +71 -61
- package/components/radio/README.md +172 -0
- package/components/radio/radio.vue +13 -0
- package/components/radio/variables.scss +1 -1
- package/components/radio-group/radio-group.vue +16 -0
- package/components/radio-input/README.md +44 -0
- package/components/radio-input/common.d.ts +3 -1
- package/components/radio-input/common.js +5 -1
- package/components/radio-input/radio-input.d.ts +1 -0
- package/components/radio-input/radio-input.vue +26 -2
- package/components/radio-popout/README.md +52 -0
- package/components/radio-popout/common.d.ts +1 -1
- package/components/radio-popout/radio-popout.vue +20 -0
- package/components/rate/README.md +106 -0
- package/components/rate/rate.d.ts +1 -1
- package/components/rate/rate.vue +22 -0
- package/components/rate/variables.scss +1 -1
- package/components/result/README.md +66 -0
- package/components/result/result.vue +10 -0
- package/components/row/row.vue +7 -0
- package/components/scroll-spy/README.md +70 -0
- package/components/scroll-spy/scroll-spy.vue +13 -0
- package/components/search/README.md +117 -0
- package/components/search/search.vue +25 -0
- package/components/search/variables.scss +1 -1
- package/components/share-sheet/README.md +94 -0
- package/components/share-sheet/share-sheet.vue +20 -0
- package/components/share-sheet/variables.scss +1 -1
- package/components/sidebar/README.md +118 -0
- package/components/sidebar/sidebar.vue +10 -0
- package/components/sidebar-item/sidebar-item.vue +8 -0
- package/components/signature/README.md +99 -0
- package/components/signature/signature.vue +20 -0
- package/components/skeleton/README.md +128 -0
- package/components/skeleton/skeleton.vue +12 -0
- package/components/skeleton-avatar/skeleton-avatar.vue +9 -0
- package/components/skeleton-block/skeleton-block.vue +8 -0
- package/components/skeleton-paragraph/skeleton-paragraph.vue +9 -0
- package/components/skeleton-title/skeleton-title.vue +8 -0
- package/components/slider/README.md +140 -0
- package/components/slider/slider.vue +29 -0
- package/components/space/README.md +82 -0
- package/components/space/space.vue +9 -0
- package/components/status-bar/README.md +72 -0
- package/components/status-bar/status-bar.vue +6 -0
- package/components/step/step.vue +9 -1
- package/components/stepper/README.md +94 -0
- package/components/stepper/stepper.vue +24 -0
- package/components/stepper/variables.scss +1 -1
- package/components/steps/README.md +142 -0
- package/components/steps/steps.vue +15 -0
- package/components/style/README.md +20 -0
- package/components/style/variables-dark.scss +10 -6
- package/components/style/variables.scss +17 -11
- package/components/swipe-action/README.md +82 -0
- package/components/swipe-action/swipe-action.vue +7 -0
- package/components/swiper-dot/README.md +45 -0
- package/components/swiper-dot/swiper-dot.vue +9 -0
- package/components/switch/README.md +89 -0
- package/components/switch/switch.vue +18 -0
- package/components/tab/tab.vue +8 -0
- package/components/tabbar/README.md +111 -0
- package/components/tabbar/tabbar.vue +12 -0
- package/components/tabbar-item/tabbar-item.vue +12 -0
- package/components/tabbar-pit/README.md +41 -0
- package/components/tabbar-pit/tabbar-pit.vue +5 -0
- package/components/table/README.md +162 -0
- package/components/table/table.vue +7 -0
- package/components/table-cell/table-cell.vue +7 -0
- package/components/table-row/table-row.vue +5 -0
- package/components/tabs/README.md +113 -0
- package/components/tabs/tabs.vue +10 -0
- package/components/tag/README.md +96 -0
- package/components/tag/common.d.ts +1 -1
- package/components/tag/index.scss +5 -1
- package/components/tag/tag.vue +16 -2
- package/components/timeline/README.md +66 -0
- package/components/timeline/timeline.vue +4 -0
- package/components/timeline/variables.scss +1 -1
- package/components/timeline-item/timeline-item.vue +9 -0
- package/components/toast/README.md +111 -0
- package/components/toast/toast.vue +11 -0
- package/components/toast-agent/toast-agent.vue +11 -0
- package/components/tree/README.md +208 -0
- package/components/tree/tree.vue +21 -0
- package/components/tree/variables.scss +3 -3
- package/components/upload/README.md +154 -0
- package/components/upload/common.d.ts +1 -0
- package/components/upload/upload.d.ts +1 -1
- package/components/upload/upload.vue +67 -26
- package/package.json +74 -45
- package/use/useFormPopout.d.ts +1 -1
- package/use/useFormPopout.js +4 -1
- package/use/usePopoutInput.d.ts +2 -1
- package/use/usePopoutInput.js +7 -4
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Layout
|
|
4
|
+
subtitle: 布局
|
|
5
|
+
group: 布局
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
基于行/列来划分区块以展示内容。栅格系统提供了 12 列容器来布局,需要配套使用`Row`和`Col`组件。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Row from 'sard-uniapp/components/row/row.vue'
|
|
16
|
+
import Col from 'sard-uniapp/components/col/col.vue'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 代码演示
|
|
20
|
+
|
|
21
|
+
### 基础使用
|
|
22
|
+
|
|
23
|
+
使用`span`属性配置子元素占据的列数。
|
|
24
|
+
|
|
25
|
+
@code('${DEMO_PATH}/layout/demo/Basic.vue')
|
|
26
|
+
|
|
27
|
+
### 列偏移
|
|
28
|
+
|
|
29
|
+
使用`offset`可以将列向右侧偏。
|
|
30
|
+
|
|
31
|
+
@code('${DEMO_PATH}/layout/demo/Offset.vue')
|
|
32
|
+
|
|
33
|
+
### 水平对齐
|
|
34
|
+
|
|
35
|
+
`justify`属性可以配置子元素在父容器中的水平对齐方式。
|
|
36
|
+
|
|
37
|
+
@code('${DEMO_PATH}/layout/demo/Justify.vue')
|
|
38
|
+
|
|
39
|
+
### 垂直对齐
|
|
40
|
+
|
|
41
|
+
`align`属性可以配置子元素在父容器中的垂直对齐方式。
|
|
42
|
+
|
|
43
|
+
@code('${DEMO_PATH}/layout/demo/Align.vue')
|
|
44
|
+
|
|
45
|
+
### 列间距
|
|
46
|
+
|
|
47
|
+
`gap`属性可以配置子元素之间的距离。
|
|
48
|
+
|
|
49
|
+
@code('${DEMO_PATH}/layout/demo/Gap.vue')
|
|
50
|
+
|
|
51
|
+
### 列顺序
|
|
52
|
+
|
|
53
|
+
通过`order`来改变元素的排序。
|
|
54
|
+
|
|
55
|
+
@code('${DEMO_PATH}/layout/demo/Order.vue')
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
### RowProps
|
|
60
|
+
|
|
61
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
62
|
+
| ---------- | -------------- | ----------------------------------------------------------------- | ------ |
|
|
63
|
+
| root-class | 组件根元素类名 | string | - |
|
|
64
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
65
|
+
| gap | 列间距 | string | - |
|
|
66
|
+
| justify | 水平对齐方式 | 'start' \| 'center' \| 'end' \| 'around' \| 'between' \| 'evenly' | - |
|
|
67
|
+
| align | 垂直对齐方式 | 'start' \| 'center' \| 'end' \| 'stretch' | - |
|
|
68
|
+
|
|
69
|
+
### RowSlots
|
|
70
|
+
|
|
71
|
+
| 插槽 | 描述 | 属性 |
|
|
72
|
+
| ------- | -------------- | ---- |
|
|
73
|
+
| default | 自定义默认内容 | - |
|
|
74
|
+
|
|
75
|
+
### ColProps
|
|
76
|
+
|
|
77
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
78
|
+
| ---------- | -------------- | -------------------------- | ------ |
|
|
79
|
+
| root-class | 组件根元素类名 | string | - |
|
|
80
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
81
|
+
| span | 列元素宽度 | number \| 'auto' \| 'none' | - |
|
|
82
|
+
| offset | 列元素偏移距离 | number | - |
|
|
83
|
+
| order | 列元素顺序 | number | - |
|
|
84
|
+
|
|
85
|
+
### ColSlots
|
|
86
|
+
|
|
87
|
+
| 插槽 | 描述 | 属性 |
|
|
88
|
+
| ------- | -------------- | ---- |
|
|
89
|
+
| default | 自定义默认内容 | - |
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: List
|
|
4
|
+
subtitle: 列表
|
|
5
|
+
group: 数据展示
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
显示一组垂直排列的数据。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import List from 'sard-uniapp/components/list/list.vue'
|
|
16
|
+
import ListItem from 'sard-uniapp/components/list-item/list-item.vue'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 代码演示
|
|
20
|
+
|
|
21
|
+
### 基础使用
|
|
22
|
+
|
|
23
|
+
可以给列表项添加标题、描述和值。
|
|
24
|
+
|
|
25
|
+
@code('${DEMO_PATH}/list/demo/Basic.vue')
|
|
26
|
+
|
|
27
|
+
### 可链接的
|
|
28
|
+
|
|
29
|
+
设置 `arrow` 属性会显示右边的箭头,设置 `hover` 属性会有点击状态。
|
|
30
|
+
|
|
31
|
+
@code('${DEMO_PATH}/list/demo/Linkable.vue')
|
|
32
|
+
|
|
33
|
+
### 图标
|
|
34
|
+
|
|
35
|
+
设置`icon`属性或插槽可以在左边显示图标。
|
|
36
|
+
|
|
37
|
+
@code('${DEMO_PATH}/list/demo/Icon.vue')
|
|
38
|
+
|
|
39
|
+
### 自定义内容
|
|
40
|
+
|
|
41
|
+
列表项的`body`和`footer`默认平分水平空间,如果`footer`需要占据更多的空间,可以设置`body`不扩展。
|
|
42
|
+
|
|
43
|
+
`value`中的元素默认会向右边靠,如果有使用`footer`属性定义内容,则内容会纵向排列。
|
|
44
|
+
|
|
45
|
+
@code('${DEMO_PATH}/list/demo/Slot.vue')
|
|
46
|
+
|
|
47
|
+
### 列表标题和描述
|
|
48
|
+
|
|
49
|
+
列表标题和描述可以对整个列表进行说明
|
|
50
|
+
|
|
51
|
+
@code('${DEMO_PATH}/list/demo/Group.vue')
|
|
52
|
+
|
|
53
|
+
### 卡片风格
|
|
54
|
+
|
|
55
|
+
可以使用`card`属性让列表显示为卡片风格。
|
|
56
|
+
|
|
57
|
+
@code('${DEMO_PATH}/list/demo/Card.vue')
|
|
58
|
+
|
|
59
|
+
## API
|
|
60
|
+
|
|
61
|
+
### ListProps
|
|
62
|
+
|
|
63
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
64
|
+
| ----------- | -------------- | ---------------- | ------ |
|
|
65
|
+
| root-class | 组件根元素类名 | string | - |
|
|
66
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
67
|
+
| title | 列表顶部标题 | string \| number | - |
|
|
68
|
+
| description | 列表底部描述 | string \| number | - |
|
|
69
|
+
| card | 卡片风格 | boolean | false |
|
|
70
|
+
| inlaid | 嵌入式列表 | boolean | false |
|
|
71
|
+
|
|
72
|
+
### ListSlots
|
|
73
|
+
|
|
74
|
+
| 插槽 | 描述 | 属性 |
|
|
75
|
+
| ----------- | --------------------------------------- | ---- |
|
|
76
|
+
| default | 自定义默认内容 | - |
|
|
77
|
+
| title | 自定义标题内容,会覆盖`title`属性 | - |
|
|
78
|
+
| description | 自定义描述内容,会覆盖`description`属性 | - |
|
|
79
|
+
|
|
80
|
+
### ListItemProps
|
|
81
|
+
|
|
82
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
83
|
+
| --------------- | ---------------------------- | ------------------------- | ------- |
|
|
84
|
+
| root-class | 组件根元素类名 | string | - |
|
|
85
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
86
|
+
| title | 左侧标题 | string \| number | - |
|
|
87
|
+
| description | 标题下方的描述 | string \| number | - |
|
|
88
|
+
| value | 右侧值 | string \| number | - |
|
|
89
|
+
| hover | 是否开启点击反馈 | boolean | false |
|
|
90
|
+
| arrow | 是否展示右侧箭头 | boolean | false |
|
|
91
|
+
| arrow-direction | 箭头方向 | 'up' \| 'right' \| 'down' | 'right' |
|
|
92
|
+
| icon | 左侧图标名称,可以为图片路径 | string | - |
|
|
93
|
+
| icon-size | 图标尺寸 | string | - |
|
|
94
|
+
| icon-color | 图标颜色 | string | - |
|
|
95
|
+
| icon-family | 图标字体名称 | string | - |
|
|
96
|
+
|
|
97
|
+
### ListItemSlots
|
|
98
|
+
|
|
99
|
+
| 插槽 | 描述 | 属性 |
|
|
100
|
+
| ----------- | --------------------------------------- | ---- |
|
|
101
|
+
| default | 自定义默认内容,会覆盖所有内容 | - |
|
|
102
|
+
| title | 自定义标题内容,会覆盖`title`属性 | - |
|
|
103
|
+
| description | 自定义描述内容,会覆盖`description`属性 | - |
|
|
104
|
+
| value | 自定义值内容,会覆盖`value`属性 | - |
|
|
105
|
+
| arrow | 自定义箭头 | - |
|
|
106
|
+
| icon | 自定义左侧图标,会覆盖`icon`属性 | - |
|
|
107
|
+
|
|
108
|
+
### ListItemEmits
|
|
109
|
+
|
|
110
|
+
| 事件 | 描述 | 类型 |
|
|
111
|
+
| ----- | ---------------- | -------------------- |
|
|
112
|
+
| click | 点击列表项时触发 | (event: any) => void |
|
|
113
|
+
|
|
114
|
+
## 主题定制
|
|
115
|
+
|
|
116
|
+
### CSS 变量
|
|
117
|
+
|
|
118
|
+
@code('./variables.scss#variables')
|
package/components/list/list.vue
CHANGED
|
@@ -24,6 +24,14 @@ import {
|
|
|
24
24
|
isRenderVisible,
|
|
25
25
|
createBem
|
|
26
26
|
} from "../../utils";
|
|
27
|
+
/**
|
|
28
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
29
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
30
|
+
* @property {string | number} title 列表顶部标题,默认值:-。
|
|
31
|
+
* @property {string | number} description 列表底部描述,默认值:-。
|
|
32
|
+
* @property {boolean} card 卡片风格,默认值:false。
|
|
33
|
+
* @property {boolean} inlaid 嵌入式列表,默认值:false。
|
|
34
|
+
*/
|
|
27
35
|
export default _defineComponent({
|
|
28
36
|
...{
|
|
29
37
|
options: {
|
|
@@ -53,6 +53,21 @@ import SarIcon from "../icon/icon.vue";
|
|
|
53
53
|
import {
|
|
54
54
|
defaultListItemProps
|
|
55
55
|
} from "../list/common";
|
|
56
|
+
/**
|
|
57
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
58
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
59
|
+
* @property {string | number} title 左侧标题,默认值:-。
|
|
60
|
+
* @property {string | number} description 标题下方的描述,默认值:-。
|
|
61
|
+
* @property {string | number} value 右侧值,默认值:-。
|
|
62
|
+
* @property {boolean} hover 是否开启点击反馈,默认值:false。
|
|
63
|
+
* @property {boolean} arrow 是否展示右侧箭头,默认值:false。
|
|
64
|
+
* @property {'up' | 'right' | 'down'} arrowDirection 箭头方向,默认值:'right'。
|
|
65
|
+
* @property {string} icon 左侧图标名称,可以为图片路径,默认值:-。
|
|
66
|
+
* @property {string} iconSize 图标尺寸,默认值:-。
|
|
67
|
+
* @property {string} iconColor 图标颜色,默认值:-。
|
|
68
|
+
* @property {string} iconFamily 图标字体名称,默认值:-。
|
|
69
|
+
* @event {(event: any) => void} click 点击列表项时触发
|
|
70
|
+
*/
|
|
56
71
|
export default _defineComponent({
|
|
57
72
|
components: {
|
|
58
73
|
SarIcon,
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: LoadMore
|
|
4
|
+
subtitle: 加载更多
|
|
5
|
+
group: 反馈组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
放置在列表底部,做滚动加载使用,展示加载的各种状态。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import LoadMore from 'sard-uniapp/components/load-more/load-more.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
通过设置 `status` 属性展示不同的状态信息;
|
|
23
|
+
组件处于 `incomplete` 状态时点击会触发 `load-more` 事件,通常用于加载的数据不满一屏无法触底加载时使用。
|
|
24
|
+
|
|
25
|
+
处于 `error` 状态时点击会触发 `reload` 事件。
|
|
26
|
+
|
|
27
|
+
@code('${DEMO_PATH}/load-more/demo/Basic.vue')
|
|
28
|
+
|
|
29
|
+
### 配合 PullDownRefresh 组件一起使用
|
|
30
|
+
|
|
31
|
+
下面的案例代码展示了经典的“下拉刷新+上拉加载”功能实现。
|
|
32
|
+
|
|
33
|
+
@code('${DEMO_PATH}/load-more/demo/WithRefresh.vue')
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
### LoadMoreProps
|
|
38
|
+
|
|
39
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
40
|
+
| --------------- | ------------------ | -------------- | ------------------------ |
|
|
41
|
+
| root-class | 组件根元素类名 | string | - |
|
|
42
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
43
|
+
| status | 加载的状态 | LoadMoreStatus | 'incomplete' |
|
|
44
|
+
| incomplete-text | 未加载完的状态文本 | string | '加载更多' |
|
|
45
|
+
| loading-text | 加载中的状态文本 | string | '加载中...' |
|
|
46
|
+
| complete-text | 加载完的状态文本 | string | '没有更多了' |
|
|
47
|
+
| error-text | 加载错误的状态文本 | string | '请求失败,点击重新加载' |
|
|
48
|
+
|
|
49
|
+
### LoadMoreSlots
|
|
50
|
+
|
|
51
|
+
| 插槽 | 描述 | 属性 |
|
|
52
|
+
| ---------- | ------------------------------------------------------ | ---- |
|
|
53
|
+
| incomplete | 自定义未加载完的状态内容,会覆盖 `incompleteText` 属性 | - |
|
|
54
|
+
| loading | 自定义加载中的状态内容,会覆盖 `loadingText` 属性 | - |
|
|
55
|
+
| complete | 自定义加载完的状态内容,会覆盖 `completeText` 属性 | - |
|
|
56
|
+
| error | 自定义加载错误的状态内容,会覆盖 `errorText` 属性 | - |
|
|
57
|
+
|
|
58
|
+
### LoadMoreEmits
|
|
59
|
+
|
|
60
|
+
| 事件 | 描述 | 类型 |
|
|
61
|
+
| --------- | -------------------------------- | ---------- |
|
|
62
|
+
| load-more | 在 `incomplete` 状态下点击时触发 | () => void |
|
|
63
|
+
| reload | 在 `error` 状态下点击时触发 | () => void |
|
|
64
|
+
|
|
65
|
+
### LoadMoreStatus
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
type LoadMoreStatus = 'incomplete' | 'loading' | 'complete' | 'error'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 主题定制
|
|
72
|
+
|
|
73
|
+
### CSS 变量
|
|
74
|
+
|
|
75
|
+
@code('./variables.scss#variables')
|
|
@@ -26,6 +26,17 @@ import {
|
|
|
26
26
|
} from "./common";
|
|
27
27
|
import { useTranslate } from "../locale";
|
|
28
28
|
import SarLoading from "../loading/loading.vue";
|
|
29
|
+
/**
|
|
30
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
31
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
32
|
+
* @property {LoadMoreStatus} status 加载的状态,默认值:'incomplete'。
|
|
33
|
+
* @property {string} incompleteText 未加载完的状态文本,默认值:'加载更多'。
|
|
34
|
+
* @property {string} loadingText 加载中的状态文本,默认值:'加载中...'。
|
|
35
|
+
* @property {string} completeText 加载完的状态文本,默认值:'没有更多了'。
|
|
36
|
+
* @property {string} errorText 加载错误的状态文本,默认值:'请求失败,点击重新加载'。
|
|
37
|
+
* @event {() => void} load-more 在 `incomplete` 状态下点击时触发
|
|
38
|
+
* @event {() => void} reload 在 `error` 状态下点击时触发
|
|
39
|
+
*/
|
|
29
40
|
export default _defineComponent({
|
|
30
41
|
components: {
|
|
31
42
|
SarLoading,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Loading
|
|
4
|
+
subtitle: 加载
|
|
5
|
+
group: 反馈组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
表示处理中的状态。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Button from 'sard-uniapp/components/loading/loading.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
@code('${DEMO_PATH}/loading/demo/Basic.vue')
|
|
23
|
+
|
|
24
|
+
### 加载类型
|
|
25
|
+
|
|
26
|
+
使用`type`属性设置不同类型。
|
|
27
|
+
|
|
28
|
+
@code('${DEMO_PATH}/loading/demo/Type.vue')
|
|
29
|
+
|
|
30
|
+
### 加载文案
|
|
31
|
+
|
|
32
|
+
通过`text`属性或者默认插槽展示文字。
|
|
33
|
+
|
|
34
|
+
@code('${DEMO_PATH}/loading/demo/Text.vue')
|
|
35
|
+
|
|
36
|
+
### 垂直排布
|
|
37
|
+
|
|
38
|
+
通过`vertical`属性设置图标和文字垂直排布。
|
|
39
|
+
|
|
40
|
+
@code('${DEMO_PATH}/loading/demo/Vertical.vue')
|
|
41
|
+
|
|
42
|
+
### 加载尺寸
|
|
43
|
+
|
|
44
|
+
`size`属性设置图标大小,`textSize`属性设置文字大小。
|
|
45
|
+
|
|
46
|
+
@code('${DEMO_PATH}/loading/demo/Size.vue')
|
|
47
|
+
|
|
48
|
+
### 自定义颜色
|
|
49
|
+
|
|
50
|
+
`color`属性设置图标颜色,`textColor`属性设置文字颜色。
|
|
51
|
+
|
|
52
|
+
@code('${DEMO_PATH}/loading/demo/Color.vue')
|
|
53
|
+
|
|
54
|
+
### 自定义图标
|
|
55
|
+
|
|
56
|
+
通过 `circular` 插槽可以自定义加载图标。
|
|
57
|
+
|
|
58
|
+
@code('${DEMO_PATH}/loading/demo/Custom.vue')
|
|
59
|
+
|
|
60
|
+
## API
|
|
61
|
+
|
|
62
|
+
### LoadingProps
|
|
63
|
+
|
|
64
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
65
|
+
| ---------- | ---------------------- | --------------------- | ---------- |
|
|
66
|
+
| root-class | 组件根元素类名 | string | - |
|
|
67
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
68
|
+
| type | 加载类型 | 'clock' \| 'circular' | 'circular' |
|
|
69
|
+
| color | 加载颜色 | string | - |
|
|
70
|
+
| size | 图标尺寸 | string | - |
|
|
71
|
+
| text | 图标文字 | string | - |
|
|
72
|
+
| text-color | 文字颜色 | string | - |
|
|
73
|
+
| text-size | 文字尺寸 | string | - |
|
|
74
|
+
| vertical | 是否垂直排列图标和文案 | boolean | false |
|
|
75
|
+
| animated | 是否开启加载动画 | boolean | true |
|
|
76
|
+
| progress | 当前加载的进度 | number | 1 |
|
|
77
|
+
|
|
78
|
+
### LoadingSlots
|
|
79
|
+
|
|
80
|
+
| 插槽 | 描述 | 属性 |
|
|
81
|
+
| -------- | ---------------------------- | ---- |
|
|
82
|
+
| default | 自定义加载文字内容 | - |
|
|
83
|
+
| circular | 自定义 `circular` 类型的图标 | - |
|
|
84
|
+
|
|
85
|
+
## 主题定制
|
|
86
|
+
|
|
87
|
+
### CSS 变量
|
|
88
|
+
|
|
89
|
+
@code('./variables.scss#variables')
|
|
@@ -47,6 +47,19 @@ import {
|
|
|
47
47
|
import {
|
|
48
48
|
defaultLoadingProps
|
|
49
49
|
} from "./common";
|
|
50
|
+
/**
|
|
51
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
52
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
53
|
+
* @property {'clock' | 'circular'} type 加载类型,默认值:'circular'。
|
|
54
|
+
* @property {string} color 加载颜色,默认值:-。
|
|
55
|
+
* @property {string} size 图标尺寸,默认值:-。
|
|
56
|
+
* @property {string} text 图标文字,默认值:-。
|
|
57
|
+
* @property {string} textColor 文字颜色,默认值:-。
|
|
58
|
+
* @property {string} textSize 文字尺寸,默认值:-。
|
|
59
|
+
* @property {boolean} vertical 是否垂直排列图标和文案,默认值:false。
|
|
60
|
+
* @property {boolean} animated 是否开启加载动画,默认值:true。
|
|
61
|
+
* @property {number} progress 当前加载的进度,默认值:1。
|
|
62
|
+
*/
|
|
50
63
|
export default _defineComponent({
|
|
51
64
|
...{
|
|
52
65
|
options: {
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: LuckyDraw
|
|
4
|
+
subtitle: 幸运抽奖
|
|
5
|
+
group:
|
|
6
|
+
title: 活动组件
|
|
7
|
+
order: 6
|
|
8
|
+
version: 1.2+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 介绍
|
|
12
|
+
|
|
13
|
+
提供了几个组合式函数,封装了九宫格、幸运大转盘、老虎机等抽奖的主要逻辑。布局与样式需自行实现,可拷贝案例代码再进行修改。
|
|
14
|
+
|
|
15
|
+
## 引入
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { useLuckyGrid, useLuckyWheel, useSlotMachine } from 'sard-uniapp'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 代码演示
|
|
22
|
+
|
|
23
|
+
### 九宫格
|
|
24
|
+
|
|
25
|
+
遍历 `useLuckyGrid` 返回的 `grids` 计算属性来渲染九宫格;`activeIndex` 计算属性用于判断当前活动的奖品。
|
|
26
|
+
|
|
27
|
+
点击按钮后调用 `play` 方法开始动画;
|
|
28
|
+
|
|
29
|
+
在确定抽中的奖品下标时调用 `stop` 方法开始减速动画;
|
|
30
|
+
|
|
31
|
+
在动画完全停止后调用 `complete` 回调函数展示抽中的奖品。
|
|
32
|
+
|
|
33
|
+
@code('${DEMO_PATH}/lucky-draw/demo/BasicGrid.vue')
|
|
34
|
+
|
|
35
|
+
utils.ts
|
|
36
|
+
|
|
37
|
+
@code('${DEMO_PATH}/lucky-draw/demo/utils.ts')
|
|
38
|
+
|
|
39
|
+
### 自定义宫格行列
|
|
40
|
+
|
|
41
|
+
`useLuckyGrid` 默认会生成 3x3 个格子,也可以自定义行列数。
|
|
42
|
+
|
|
43
|
+
宫格的外边缘格子下标从左上角以 0 开始逆时针递增,内部的格子下标从左到右、从上到下以 -1 开始递减。
|
|
44
|
+
|
|
45
|
+
`centerSize` 计算属性可用于获取中间格子的行列数。
|
|
46
|
+
|
|
47
|
+
@code('${DEMO_PATH}/lucky-draw/demo/GridSize.vue')
|
|
48
|
+
|
|
49
|
+
### 大转盘
|
|
50
|
+
|
|
51
|
+
大转盘与宫格抽奖逻辑类似。
|
|
52
|
+
|
|
53
|
+
`count` 选项用于指定奖品数量;
|
|
54
|
+
|
|
55
|
+
`useLuckyWheel` 函数返回的 `sectorDegrees` 计算属性为每个奖品所占的角度;
|
|
56
|
+
|
|
57
|
+
`degrees` 计算属性为整个大转盘当前旋转的角度。
|
|
58
|
+
|
|
59
|
+
@code('${DEMO_PATH}/lucky-draw/demo/Wheel.vue')
|
|
60
|
+
|
|
61
|
+
### 老虎机
|
|
62
|
+
|
|
63
|
+
老虎机可以一次性抽取多个奖品。
|
|
64
|
+
|
|
65
|
+
`columns` 选项用于指定列数以及每列的奖品数量;
|
|
66
|
+
|
|
67
|
+
`offset` 计算属性保存着每一列的百分比偏移量,每一列奖品容器的高度需和奖品高度一致;
|
|
68
|
+
|
|
69
|
+
为了实现首位相接的效果,还需在渲染的奖品列表的末尾加上第一个奖品。
|
|
70
|
+
|
|
71
|
+
@code('${DEMO_PATH}/lucky-draw/demo/SlotMechine.vue')
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
### useLuckyGrid
|
|
76
|
+
|
|
77
|
+
```ts
|
|
78
|
+
function useLuckyGrid(options?: UseLuckyGridOptions): UseLuckyGridReturn
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### UseLuckyGridOptions
|
|
82
|
+
|
|
83
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
84
|
+
| ---------- | ------------------------------ | ---------------------------- | ------------------- |
|
|
85
|
+
| row | 宫格行数 | number \| Ref\<number> | 3 |
|
|
86
|
+
| column | 宫格列数 | number \| Ref\<number> | 3 |
|
|
87
|
+
| minSpeed | 最小加速度 | number \| Ref\<number> | 0.1 |
|
|
88
|
+
| maxSpeed | 最大加速度 | number \| Ref\<number> | 0.4 |
|
|
89
|
+
| accelTime | 加速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
90
|
+
| decelTime | 减速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
91
|
+
| easeIn | 加速缓动公式 | (progress: number) => number | (k) => k \* k |
|
|
92
|
+
| easeOut | 减速缓动公式 | (progress: number) => number | (k) => k \* (2 - k) |
|
|
93
|
+
| startDelay | 加速运动前的等待时间,单位毫秒 | number \| Ref\<number> | 0 |
|
|
94
|
+
| endDelay | 减速运动后的等待时间,单位毫秒 | number \| Ref\<number> | 500 |
|
|
95
|
+
| complete | 完成抽奖动画后的回调 | (index: number) => void | - |
|
|
96
|
+
|
|
97
|
+
### UseLuckyGridReturn
|
|
98
|
+
|
|
99
|
+
| 属性 | 描述 | 类型 |
|
|
100
|
+
| ----------- | ---------------------------------------------- | ---------------------------------------------- |
|
|
101
|
+
| play | 调用后开始抽奖 | () => void |
|
|
102
|
+
| stop | 调用后开始减速动画 | (index?: number) => void |
|
|
103
|
+
| pause | 调用后暂停动画 | () => void |
|
|
104
|
+
| reset | 调用后重置动画 | () => void |
|
|
105
|
+
| playing | 用于判断当前是否正在动画 | ComputedRef\<boolean> |
|
|
106
|
+
| activeIndex | 用于判断当前活动的下标 | ComputedRef\<number \| undefined> |
|
|
107
|
+
| grids | 用于渲染成宫格,并根据下标判断奖品和非奖品位置 | ComputedRef\<number[]> |
|
|
108
|
+
| centerSize | 用于渲染中间非奖品格子的行列数 | ComputedRef\<{ row: number; column: number; }> |
|
|
109
|
+
|
|
110
|
+
### useLuckyWheel
|
|
111
|
+
|
|
112
|
+
```ts
|
|
113
|
+
function useLuckyWheel(options?: UseLuckyWheelOptions): UseLuckyWheelReturn
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### UseLuckyWheelOptions
|
|
117
|
+
|
|
118
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
119
|
+
| ---------- | ------------------------------ | ---------------------------- | ------------------- |
|
|
120
|
+
| count | 奖品个数 | number \| Ref\<number> | 8 |
|
|
121
|
+
| minSpeed | 最小加速度 | number \| Ref\<number> | 0.01 |
|
|
122
|
+
| maxSpeed | 最大加速度 | number \| Ref\<number> | 0.4 |
|
|
123
|
+
| accelTime | 加速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
124
|
+
| decelTime | 减速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
125
|
+
| easeIn | 加速缓动公式 | (progress: number) => number | (k) => k \* k |
|
|
126
|
+
| easeOut | 减速缓动公式 | (progress: number) => number | (k) => k \* (2 - k) |
|
|
127
|
+
| startDelay | 加速运动前的等待时间,单位毫秒 | number \| Ref\<number> | 0 |
|
|
128
|
+
| endDelay | 减速运动后的等待时间,单位毫秒 | number \| Ref\<number> | 300 |
|
|
129
|
+
| complete | 完成抽奖动画后的回调 | (index: number) => void | - |
|
|
130
|
+
|
|
131
|
+
### UseLuckyWheelReturn
|
|
132
|
+
|
|
133
|
+
| 属性 | 描述 | 类型 |
|
|
134
|
+
| ------------- | -------------------------------- | ------------------------ |
|
|
135
|
+
| play | 调用后开始抽奖 | () => void |
|
|
136
|
+
| stop | 调用后开始减速动画 | (index?: number) => void |
|
|
137
|
+
| pause | 调用后暂停动画 | () => void |
|
|
138
|
+
| reset | 调用后重置动画 | () => void |
|
|
139
|
+
| playing | 用于判断当前是否正在动画 | ComputedRef\<boolean> |
|
|
140
|
+
| sectorDegrees | 每个扇形奖品所占的角度,单位 deg | ComputedRef\<number> |
|
|
141
|
+
| degrees | 当前转盘渲染的角度,单位 deg | ComputedRef\<number> |
|
|
142
|
+
|
|
143
|
+
### useSlotMachine
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
function useSlotMachine(options: UseSlotMachineOptions): UseSlotMachineReturn
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### UseSlotMachineOptions
|
|
150
|
+
|
|
151
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
152
|
+
| ------------ | ------------------------------ | -------------------------------------------------------- | ------------------- |
|
|
153
|
+
| columns | 奖品个数 | number[] \| unknown[][] \| Ref\<number[] \| unknown[][]> | [] |
|
|
154
|
+
| staggerDelay | 列间交错延迟时间,单位毫秒 | number \| Ref\<number> | 600 |
|
|
155
|
+
| minSpeed | 最小加速度 | number \| Ref\<number> | 0.01 |
|
|
156
|
+
| maxSpeed | 最大加速度 | number \| Ref\<number> | 0.3 |
|
|
157
|
+
| accelTime | 加速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
158
|
+
| decelTime | 减速时间,单位毫秒 | number \| Ref\<number> | 2500 |
|
|
159
|
+
| easeIn | 加速缓动公式 | (progress: number) => number | (k) => k \* k |
|
|
160
|
+
| easeOut | 减速缓动公式 | (progress: number) => number | (k) => k \* (2 - k) |
|
|
161
|
+
| startDelay | 加速运动前的等待时间,单位毫秒 | number \| Ref\<number> | 0 |
|
|
162
|
+
| endDelay | 减速运动后的等待时间,单位毫秒 | number \| Ref\<number> | 300 |
|
|
163
|
+
| complete | 完成抽奖动画后的回调 | (index: number[]) => void | - |
|
|
164
|
+
|
|
165
|
+
### UseSlotMachineReturn
|
|
166
|
+
|
|
167
|
+
| 属性 | 描述 | 类型 |
|
|
168
|
+
| ------- | ------------------------ | -------------------------- |
|
|
169
|
+
| play | 调用后开始抽奖 | () => void |
|
|
170
|
+
| stop | 调用后开始减速动画 | (index?: number[]) => void |
|
|
171
|
+
| pause | 调用后暂停动画 | () => void |
|
|
172
|
+
| reset | 调用后重置动画 | () => void |
|
|
173
|
+
| playing | 用于判断当前是否正在动画 | ComputedRef\<boolean> |
|
|
174
|
+
| offset | 每一列的当前偏移量 | ComputedRef\<number[]> |
|