sard-uniapp 1.19.2 → 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 +10 -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/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 +19 -0
- package/components/calendar-input/README.md +65 -0
- package/components/calendar-input/calendar-input.vue +31 -0
- package/components/calendar-popout/README.md +100 -0
- package/components/calendar-popout/calendar-popout.vue +25 -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.vue +25 -0
- package/components/cascader-popout/README.md +53 -0
- package/components/cascader-popout/cascader-popout.vue +19 -0
- package/components/checkbox/README.md +185 -0
- package/components/checkbox/checkbox.vue +17 -0
- package/components/checkbox-group/checkbox-group.vue +15 -0
- package/components/checkbox-input/README.md +44 -0
- package/components/checkbox-input/checkbox-input.vue +22 -0
- 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 +2 -0
- package/components/config/index.js +1 -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/datetime-picker-input.vue +25 -0
- package/components/datetime-picker-popout/README.md +77 -0
- package/components/datetime-picker-popout/datetime-picker-popout.vue +19 -0
- 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/datetime-range-picker-input.vue +26 -0
- package/components/datetime-range-picker-popout/README.md +53 -0
- package/components/datetime-range-picker-popout/datetime-range-picker-popout.vue +20 -0
- package/components/dialog/README.md +192 -0
- package/components/dialog/dialog.vue +33 -0
- 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.vue +16 -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/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/input.vue +55 -0
- 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/picker.vue +10 -0
- package/components/picker-input/README.md +51 -0
- package/components/picker-input/picker-input.vue +21 -0
- package/components/picker-popout/README.md +51 -0
- package/components/picker-popout/picker-popout.vue +15 -0
- package/components/popout/README.md +111 -0
- package/components/popout/popout.vue +29 -0
- package/components/popout-input/README.md +55 -0
- package/components/popout-input/popout-input.vue +15 -0
- 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.vue +11 -0
- package/components/qrcode/README.md +103 -0
- package/components/qrcode/qrcode.vue +13 -0
- package/components/radio/README.md +172 -0
- package/components/radio/radio.vue +13 -0
- package/components/radio-group/radio-group.vue +16 -0
- package/components/radio-input/README.md +44 -0
- package/components/radio-input/radio-input.vue +23 -0
- package/components/radio-popout/README.md +52 -0
- package/components/radio-popout/radio-popout.vue +20 -0
- package/components/rate/README.md +106 -0
- package/components/rate/rate.vue +22 -0
- 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/share-sheet/README.md +94 -0
- package/components/share-sheet/share-sheet.vue +20 -0
- 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/steps/README.md +142 -0
- package/components/steps/steps.vue +15 -0
- package/components/style/README.md +20 -0
- 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/tag.vue +14 -0
- package/components/timeline/README.md +66 -0
- package/components/timeline/timeline.vue +4 -0
- 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/upload/README.md +154 -0
- package/components/upload/upload.vue +22 -0
- package/package.json +74 -45
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Signature
|
|
4
|
+
subtitle: 签名
|
|
5
|
+
group: 表单组件
|
|
6
|
+
version: 1.12+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 介绍
|
|
10
|
+
|
|
11
|
+
用于签名场景的组件,基于 Canvas 实现。
|
|
12
|
+
|
|
13
|
+
## 引入
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import Signature from 'sard-uniapp/components/signature/signature.vue'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 代码演示
|
|
20
|
+
|
|
21
|
+
### 基础使用
|
|
22
|
+
|
|
23
|
+
书写完签名,点击确定按钮会触发 `confirm` 事件,并接收图片的 `dataURL` 或临时文件路径,如果没有书写或者点击了清空按钮,则会得到空字符串。
|
|
24
|
+
|
|
25
|
+
@code('${DEMO_PATH}/signature/demo/Basic.vue')
|
|
26
|
+
|
|
27
|
+
### 画笔颜色
|
|
28
|
+
|
|
29
|
+
使用 `color` 属性可以设置画笔的颜色。
|
|
30
|
+
|
|
31
|
+
@code('${DEMO_PATH}/signature/demo/Color.vue')
|
|
32
|
+
|
|
33
|
+
### 画笔粗细
|
|
34
|
+
|
|
35
|
+
使用 `line-width` 属性可以设置画笔的粗细。
|
|
36
|
+
|
|
37
|
+
@code('${DEMO_PATH}/signature/demo/LineWidth.vue')
|
|
38
|
+
|
|
39
|
+
### 背景色
|
|
40
|
+
|
|
41
|
+
使用 `background` 属性可以设置画板的颜色,默认为透明。如果想在最终生成的图片背景为透明的情况下设置书写时的背景颜色,则可以使用 `--sar-signature-canvas-bg` css 变量来设置。
|
|
42
|
+
|
|
43
|
+
@code('${DEMO_PATH}/signature/demo/Background.vue')
|
|
44
|
+
|
|
45
|
+
### 全屏显示
|
|
46
|
+
|
|
47
|
+
如果设置 `full-screen` 来全屏展示签名组件,此时可以绑定 `v-model:visible` 属性来控制显隐。
|
|
48
|
+
|
|
49
|
+
@code('${DEMO_PATH}/signature/demo/FullScreen.vue')
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
### SignatureProps
|
|
54
|
+
|
|
55
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
56
|
+
| ------------ | ------------------------------ | ----------------------- | --------- |
|
|
57
|
+
| root-class | 组件根元素类名 | string | - |
|
|
58
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
59
|
+
| color | 笔触颜色 | string | '#000' |
|
|
60
|
+
| line-width | 线条宽度 | number | 3 |
|
|
61
|
+
| background | 背景颜色 | string | - |
|
|
62
|
+
| full-screen | 是否全屏展示 | boolean | false |
|
|
63
|
+
| visible | 视屏时控制显隐 | boolean | false |
|
|
64
|
+
| duration | 显隐持续时间 | number | 150 |
|
|
65
|
+
| cancel-text | 取消按钮文案 | string | '取消' |
|
|
66
|
+
| clear-text | 清空按钮文案 | string | '清空' |
|
|
67
|
+
| confirm-text | 确定按钮文案 | string | '确定' |
|
|
68
|
+
| type | 导出图片类型 | 'png' \| 'jpg' | 'png' |
|
|
69
|
+
| target | confirm 事件回调接收的图片类型 | 'dataURL' \| 'filePath' | 'dataURL' |
|
|
70
|
+
| quality | 转换为 DataURL 时的质量 | number | 0.92 |
|
|
71
|
+
|
|
72
|
+
### SignatureSlots
|
|
73
|
+
|
|
74
|
+
| 插槽 | 描述 | 属性 |
|
|
75
|
+
| ------- | ---------------------- | ---- |
|
|
76
|
+
| default | 全屏时定义底部提示文案 | - |
|
|
77
|
+
|
|
78
|
+
### SignatureEmits
|
|
79
|
+
|
|
80
|
+
| 事件 | 描述 | 类型 |
|
|
81
|
+
| -------------- | ------------------ | -------------------------- |
|
|
82
|
+
| update:visible | 弹出框显隐时触发 | (visible: boolean) => void |
|
|
83
|
+
| confirm | 点击确定按钮时触发 | (dataURL: string) => void |
|
|
84
|
+
| clear | 点击清空按钮时触发 | () => void |
|
|
85
|
+
| cancel | 点击取消按钮时触发 | () => void |
|
|
86
|
+
|
|
87
|
+
### SignatureExpose
|
|
88
|
+
|
|
89
|
+
| 属性 | 描述 | 类型 |
|
|
90
|
+
| ------- | ---------------------------------------------------------- | ---------- |
|
|
91
|
+
| resize | 外层元素大小或组件显示状态变化时,可以调用此方法来触发重绘 | () => void |
|
|
92
|
+
| clear | 可调用此方法来清除签名 | () => void |
|
|
93
|
+
| confirm | 触发 `confirm` 事件,与点击确认按钮的效果等价 | () => void |
|
|
94
|
+
|
|
95
|
+
## 主题定制
|
|
96
|
+
|
|
97
|
+
### CSS 变量
|
|
98
|
+
|
|
99
|
+
@code('./variables.scss#variables')
|
|
@@ -102,6 +102,26 @@ import SarButton from "../button/button.vue";
|
|
|
102
102
|
import { useTransition, useZIndex } from "../../use";
|
|
103
103
|
import { useTranslate } from "../locale";
|
|
104
104
|
import SarStatusBar from "../status-bar/status-bar.vue";
|
|
105
|
+
/**
|
|
106
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
107
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
108
|
+
* @property {string} color 笔触颜色,默认值:'#000'。
|
|
109
|
+
* @property {number} lineWidth 线条宽度,默认值:3。
|
|
110
|
+
* @property {string} background 背景颜色,默认值:-。
|
|
111
|
+
* @property {boolean} fullScreen 是否全屏展示,默认值:false。
|
|
112
|
+
* @property {boolean} visible 视屏时控制显隐,默认值:false。
|
|
113
|
+
* @property {number} duration 显隐持续时间,默认值:150。
|
|
114
|
+
* @property {string} cancelText 取消按钮文案,默认值:'取消'。
|
|
115
|
+
* @property {string} clearText 清空按钮文案,默认值:'清空'。
|
|
116
|
+
* @property {string} confirmText 确定按钮文案,默认值:'确定'。
|
|
117
|
+
* @property {'png' | 'jpg'} type 导出图片类型,默认值:'png'。
|
|
118
|
+
* @property {'dataURL' | 'filePath'} target confirm 事件回调接收的图片类型,默认值:'dataURL'。
|
|
119
|
+
* @property {number} quality 转换为 DataURL 时的质量,默认值:0.92。
|
|
120
|
+
* @event {(visible: boolean) => void} update 弹出框显隐时触发
|
|
121
|
+
* @event {(dataURL: string) => void} confirm 点击确定按钮时触发
|
|
122
|
+
* @event {() => void} clear 点击清空按钮时触发
|
|
123
|
+
* @event {() => void} cancel 点击取消按钮时触发
|
|
124
|
+
*/
|
|
105
125
|
export default _defineComponent({
|
|
106
126
|
components: {
|
|
107
127
|
SarButton,
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Skeleton
|
|
4
|
+
subtitle: 骨架屏
|
|
5
|
+
group: 反馈组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
在内容加载过程中提供一组占位图形,通常图形会描述内容的概要排版。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Skeleton from 'sard-uniapp/components/skeleton/skeleton.vue'
|
|
16
|
+
import SkeletonBlock from 'sard-uniapp/components/skeleton-block/skeleton-block.vue'
|
|
17
|
+
import SkeletonAvatar from 'sard-uniapp/components/skeleton-avatar/skeleton-avatar.vue'
|
|
18
|
+
import SkeletonTitle from 'sard-uniapp/components/skeleton-title/skeleton-title.vue'
|
|
19
|
+
import SkeletonParagraph from 'sard-uniapp/components/skeleton-paragraph/skeleton-paragraph.vue'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 代码演示
|
|
23
|
+
|
|
24
|
+
### 基础使用
|
|
25
|
+
|
|
26
|
+
默认展示三行占位元素。
|
|
27
|
+
|
|
28
|
+
@code('${DEMO_PATH}/skeleton/demo/Basic.vue')
|
|
29
|
+
|
|
30
|
+
### 显示标题
|
|
31
|
+
|
|
32
|
+
设置 `title` 属性显示标题占位元素。
|
|
33
|
+
|
|
34
|
+
@code('${DEMO_PATH}/skeleton/demo/Title.vue')
|
|
35
|
+
|
|
36
|
+
### 显示头像
|
|
37
|
+
|
|
38
|
+
设置 `avatar` 属性显示头像占位元素。
|
|
39
|
+
|
|
40
|
+
@code('${DEMO_PATH}/skeleton/demo/Avatar.vue')
|
|
41
|
+
|
|
42
|
+
### 圆形头像
|
|
43
|
+
|
|
44
|
+
设置 `avatarRound` 属性显示头圆形像占位元素。
|
|
45
|
+
|
|
46
|
+
@code('${DEMO_PATH}/skeleton/demo/RoundAvatar.vue')
|
|
47
|
+
|
|
48
|
+
### 圆角标题和段落
|
|
49
|
+
|
|
50
|
+
设置 `round` 属性显示圆角标题和段落。
|
|
51
|
+
|
|
52
|
+
@code('${DEMO_PATH}/skeleton/demo/RoundTitle.vue')
|
|
53
|
+
|
|
54
|
+
### 动画效果
|
|
55
|
+
|
|
56
|
+
设置 `animated` 属性显示动画效果。
|
|
57
|
+
|
|
58
|
+
@code('${DEMO_PATH}/skeleton/demo/Animated.vue')
|
|
59
|
+
|
|
60
|
+
### 包含子组件
|
|
61
|
+
|
|
62
|
+
将 `loading` 属性设置成 `false` 表示内容加载完成,此时会隐藏占位图。
|
|
63
|
+
|
|
64
|
+
@code('${DEMO_PATH}/skeleton/demo/Contain.vue')
|
|
65
|
+
|
|
66
|
+
### 自定义
|
|
67
|
+
|
|
68
|
+
可以通过 `SkeletonBlock`、`SkeletonAvatar`、`SkeletonTitle`、`SkeletonParagraph` 自由组合使用。
|
|
69
|
+
|
|
70
|
+
@code('${DEMO_PATH}/skeleton/demo/Custom.vue')
|
|
71
|
+
|
|
72
|
+
## API
|
|
73
|
+
|
|
74
|
+
### SkeletonProps
|
|
75
|
+
|
|
76
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
77
|
+
| ------------ | --------------------------------------------- | ---------------- | ------ |
|
|
78
|
+
| root-class | 组件根元素类名 | string | - |
|
|
79
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
80
|
+
| rows | 段落行数 | number | 3 |
|
|
81
|
+
| title | 是否显示标题 | boolean | false |
|
|
82
|
+
| avatar | 是否显示头像 | boolean | false |
|
|
83
|
+
| avatar-size | 头像尺寸 | number \| string | - |
|
|
84
|
+
| avatar-round | 是否显示圆形头像 | boolean | true |
|
|
85
|
+
| round | 是否将标题和段落显示为圆角风格 | boolean | false |
|
|
86
|
+
| loading | 是否显示骨架屏,传 `false` 时会展示子组件内容 | boolean | true |
|
|
87
|
+
| animated | 是否开启动画 | boolean | false |
|
|
88
|
+
|
|
89
|
+
### SkeletonBlockProps
|
|
90
|
+
|
|
91
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
92
|
+
| ---------- | ------------------ | ---------- | ------ |
|
|
93
|
+
| root-class | 组件根元素类名 | string | - |
|
|
94
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
95
|
+
| animated | 是否开启动画 | boolean | false |
|
|
96
|
+
| round | 是否显示为圆角风格 | boolean | false |
|
|
97
|
+
| width | 设置宽度 | string | - |
|
|
98
|
+
| height | 设置高度 | string | - |
|
|
99
|
+
|
|
100
|
+
### SkeletonAvatarProps
|
|
101
|
+
|
|
102
|
+
继承 [`SkeletonBlockProps`](#SkeletonBlockProps) 并有以下额外属性。
|
|
103
|
+
|
|
104
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
105
|
+
| ---- | -------- | ------ | ------ |
|
|
106
|
+
| size | 头像尺寸 | string | - |
|
|
107
|
+
|
|
108
|
+
### SkeletonTitleProps
|
|
109
|
+
|
|
110
|
+
继承 [`SkeletonBlockProps`](#SkeletonBlockProps) 并有以下额外属性。
|
|
111
|
+
|
|
112
|
+
### SkeletonParagraphProps
|
|
113
|
+
|
|
114
|
+
继承 [`SkeletonBlockProps`](#SkeletonBlockProps) 并有以下额外属性。
|
|
115
|
+
|
|
116
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
117
|
+
| ---- | -------- | ------ | ------ |
|
|
118
|
+
| rows | 段落行数 | number | 3 |
|
|
119
|
+
|
|
120
|
+
## 主题定制
|
|
121
|
+
|
|
122
|
+
### CSS 变量
|
|
123
|
+
|
|
124
|
+
@code('./variables.scss#variables')
|
|
125
|
+
|
|
126
|
+
### CSS 变量 - 暗黑模式
|
|
127
|
+
|
|
128
|
+
@code('./variables-dark.scss#variables')
|
|
@@ -29,6 +29,18 @@ import SarSkeletonParagraph from "../skeleton-paragraph/skeleton-paragraph.vue";
|
|
|
29
29
|
import {
|
|
30
30
|
defaultSkeletonProps
|
|
31
31
|
} from "./common";
|
|
32
|
+
/**
|
|
33
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
34
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
35
|
+
* @property {number} rows 段落行数,默认值:3。
|
|
36
|
+
* @property {boolean} title 是否显示标题,默认值:false。
|
|
37
|
+
* @property {boolean} avatar 是否显示头像,默认值:false。
|
|
38
|
+
* @property {number | string} avatarSize 头像尺寸,默认值:-。
|
|
39
|
+
* @property {boolean} avatarRound 是否显示圆形头像,默认值:true。
|
|
40
|
+
* @property {boolean} round 是否将标题和段落显示为圆角风格,默认值:false。
|
|
41
|
+
* @property {boolean} loading 是否显示骨架屏,传 `false` 时会展示子组件内容,默认值:true。
|
|
42
|
+
* @property {boolean} animated 是否开启动画,默认值:false。
|
|
43
|
+
*/
|
|
32
44
|
export default _defineComponent({
|
|
33
45
|
components: {
|
|
34
46
|
SarSkeletonAvatar,
|
|
@@ -14,6 +14,15 @@ import { defineComponent as _defineComponent } from "vue";
|
|
|
14
14
|
import { computed } from "vue";
|
|
15
15
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
16
16
|
import SarSkeletonBlock from "../skeleton-block/skeleton-block.vue";
|
|
17
|
+
/**
|
|
18
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
19
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
20
|
+
* @property {boolean} animated 是否开启动画,默认值:false。
|
|
21
|
+
* @property {boolean} round 是否显示为圆角风格,默认值:false。
|
|
22
|
+
* @property {string} width 设置宽度,默认值:-。
|
|
23
|
+
* @property {string} height 设置高度,默认值:-。
|
|
24
|
+
* @property {string} size 头像尺寸,默认值:-。
|
|
25
|
+
*/
|
|
17
26
|
export default _defineComponent({
|
|
18
27
|
components: {
|
|
19
28
|
SarSkeletonBlock,
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
import { defineComponent as _defineComponent } from "vue";
|
|
7
7
|
import { computed } from "vue";
|
|
8
8
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
9
|
+
/**
|
|
10
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
11
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
12
|
+
* @property {boolean} animated 是否开启动画,默认值:false。
|
|
13
|
+
* @property {boolean} round 是否显示为圆角风格,默认值:false。
|
|
14
|
+
* @property {string} width 设置宽度,默认值:-。
|
|
15
|
+
* @property {string} height 设置高度,默认值:-。
|
|
16
|
+
*/
|
|
9
17
|
export default _defineComponent({
|
|
10
18
|
...{
|
|
11
19
|
options: {
|
|
@@ -17,6 +17,15 @@ import { defineComponent as _defineComponent } from "vue";
|
|
|
17
17
|
import { computed } from "vue";
|
|
18
18
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
19
19
|
import SarSkeletonBlock from "../skeleton-block/skeleton-block.vue";
|
|
20
|
+
/**
|
|
21
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
22
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
23
|
+
* @property {boolean} animated 是否开启动画,默认值:false。
|
|
24
|
+
* @property {boolean} round 是否显示为圆角风格,默认值:false。
|
|
25
|
+
* @property {string} width 设置宽度,默认值:-。
|
|
26
|
+
* @property {string} height 设置高度,默认值:-。
|
|
27
|
+
* @property {number} rows 段落行数,默认值:3。
|
|
28
|
+
*/
|
|
20
29
|
export default _defineComponent({
|
|
21
30
|
components: {
|
|
22
31
|
SarSkeletonBlock,
|
|
@@ -14,6 +14,14 @@ import { defineComponent as _defineComponent } from "vue";
|
|
|
14
14
|
import { computed } from "vue";
|
|
15
15
|
import { classNames, stringifyStyle, createBem } from "../../utils";
|
|
16
16
|
import SarSkeletonBlock from "../skeleton-block/skeleton-block.vue";
|
|
17
|
+
/**
|
|
18
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
19
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
20
|
+
* @property {boolean} animated 是否开启动画,默认值:false。
|
|
21
|
+
* @property {boolean} round 是否显示为圆角风格,默认值:false。
|
|
22
|
+
* @property {string} width 设置宽度,默认值:-。
|
|
23
|
+
* @property {string} height 设置高度,默认值:-。
|
|
24
|
+
*/
|
|
17
25
|
export default _defineComponent({
|
|
18
26
|
components: {
|
|
19
27
|
SarSkeletonBlock,
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Slider
|
|
4
|
+
subtitle: 滑块
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
选择给定范围的一个值和区间。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Slider from 'sard-uniapp/components/slider/slider.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
使用 `v-model` 绑定当前值。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/slider/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 范围选择
|
|
27
|
+
|
|
28
|
+
使用 `range` 属性设置成范围选择。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/slider/demo/Range.vue')
|
|
31
|
+
|
|
32
|
+
### 显示值
|
|
33
|
+
|
|
34
|
+
设置 `show-value` 属性会在滑块上方显示当前滑块对应的值。
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/slider/demo/ShowValue.vue')
|
|
37
|
+
|
|
38
|
+
### 最大最小值
|
|
39
|
+
|
|
40
|
+
使用 `min` 和 `max` 属性限制可以选择的最大最小值。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/slider/demo/MinMax.vue')
|
|
43
|
+
|
|
44
|
+
### 垂直
|
|
45
|
+
|
|
46
|
+
使用 `vertical` 属性垂直展示滑块。
|
|
47
|
+
|
|
48
|
+
@code('${DEMO_PATH}/slider/demo/Vertical.vue')
|
|
49
|
+
|
|
50
|
+
### 步长
|
|
51
|
+
|
|
52
|
+
使用 `step` 属性限制只能选择指定数字的倍数的值。
|
|
53
|
+
|
|
54
|
+
@code('${DEMO_PATH}/slider/demo/Step.vue')
|
|
55
|
+
|
|
56
|
+
### 显示刻度
|
|
57
|
+
|
|
58
|
+
设置 `show-scale` 属性可以显示步长对应的刻度,设置 `scale-position` 属性可以让刻度显示在各个方位。
|
|
59
|
+
|
|
60
|
+
@code('${DEMO_PATH}/slider/demo/ShowScale.vue')
|
|
61
|
+
|
|
62
|
+
### 自定义颜色
|
|
63
|
+
|
|
64
|
+
使用 `track-color` 属性设置轨道颜色;使用 `piece-color` 属性设置选中片段的颜色;使用 `thumb-color` 属性设置按钮的颜色。
|
|
65
|
+
|
|
66
|
+
@code('${DEMO_PATH}/slider/demo/Color.vue')
|
|
67
|
+
|
|
68
|
+
### 自定义尺寸
|
|
69
|
+
|
|
70
|
+
使用 `track-size` 属性设置轨道尺寸;使用 `thumb-size` 属性设置滑块的尺寸。
|
|
71
|
+
|
|
72
|
+
@code('${DEMO_PATH}/slider/demo/Size.vue')
|
|
73
|
+
|
|
74
|
+
### 只读和禁用
|
|
75
|
+
|
|
76
|
+
只读和禁用状态下无法操作。
|
|
77
|
+
|
|
78
|
+
@code('${DEMO_PATH}/slider/demo/DisabledReadOnly.vue')
|
|
79
|
+
|
|
80
|
+
### 自定义滑块插槽
|
|
81
|
+
|
|
82
|
+
滑块插槽可以用于自定义滑块样式。
|
|
83
|
+
|
|
84
|
+
@code('${DEMO_PATH}/slider/demo/Slot.vue')
|
|
85
|
+
|
|
86
|
+
## API
|
|
87
|
+
|
|
88
|
+
### SliderProps
|
|
89
|
+
|
|
90
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
91
|
+
| ---------------- | ---------------- | -------------------------------------- | ----------------- |
|
|
92
|
+
| root-class | 组件根元素类名 | string | - |
|
|
93
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
94
|
+
| range | 双滑块模式 | boolean | false |
|
|
95
|
+
| model-value | 滑块值 | number \| number[] | - |
|
|
96
|
+
| min | 最小值 | number | 0 |
|
|
97
|
+
| max | 最大值 | number | 100 |
|
|
98
|
+
| step | 步长 | number | 1 |
|
|
99
|
+
| vertical | 垂直方向滑块 | boolean | false |
|
|
100
|
+
| disabled | 禁用状态 | boolean | false |
|
|
101
|
+
| readonly | 只读状态 | boolean | false |
|
|
102
|
+
| piece-color | 滑块间的轨道颜色 | string | - |
|
|
103
|
+
| track-color | 滑块轨道颜色 | string | - |
|
|
104
|
+
| track-size | 滑块轨道尺寸 | string | - |
|
|
105
|
+
| thumb-color | 滑块颜色 | string | - |
|
|
106
|
+
| thumb-size | 滑块尺寸 | string | - |
|
|
107
|
+
| show-value | 是否显示值 | boolean | false |
|
|
108
|
+
| value-position | 值显示的位置 | 'top' \| 'right' \| 'bottom' \| 'left' | 'top' / 'right' |
|
|
109
|
+
| value-background | 设置值的背景色 | string | - |
|
|
110
|
+
| value-color | 设置值的字体颜色 | string | - |
|
|
111
|
+
| show-scale | 是否显示刻度 | boolean | false |
|
|
112
|
+
| scale-position | 刻度显示的位置 | 'top' \| 'right' \| 'bottom' \| 'left' | 'bottom' / 'left' |
|
|
113
|
+
| validate-event | 是否触发表单验证 | boolean | true |
|
|
114
|
+
|
|
115
|
+
### SliderSlots
|
|
116
|
+
|
|
117
|
+
| 插槽 | 描述 | 属性 |
|
|
118
|
+
| ----------- | ------------------ | ----------------- |
|
|
119
|
+
| start-thumb | 自定义起始滑块内容 | { value: number } |
|
|
120
|
+
| end-thumb | 自定义结束滑块内容 | { value: number } |
|
|
121
|
+
|
|
122
|
+
### SliderEmits
|
|
123
|
+
|
|
124
|
+
| 事件 | 描述 | 类型 |
|
|
125
|
+
| ----------------------- | -------------------------------- | ----------------------------------- |
|
|
126
|
+
| update:model-value | 滑块值实时改变时触发 | (value: number \| number[]) => void |
|
|
127
|
+
| input <sup>1.9.2+</sup> | 滑块值实时改变时触发 | (value: number \| number[]) => void |
|
|
128
|
+
| change | 滑块点击或拖动结束且值改变时触发 | (value: number \| number[]) => void |
|
|
129
|
+
| drag-start | 开始拖动时触发 | (event: TouchEvent) => void |
|
|
130
|
+
| drag-end | 结束拖动时触发 | (event: TouchEvent) => void |
|
|
131
|
+
|
|
132
|
+
## 主题定制
|
|
133
|
+
|
|
134
|
+
### CSS 变量
|
|
135
|
+
|
|
136
|
+
@code('./variables.scss#variables')
|
|
137
|
+
|
|
138
|
+
### CSS 变量 - 暗黑模式
|
|
139
|
+
|
|
140
|
+
@code('./variables-dark.scss#variables')
|
|
@@ -98,6 +98,35 @@ import {
|
|
|
98
98
|
defaultSliderProps
|
|
99
99
|
} from "./common";
|
|
100
100
|
import { useMouseDown } from "../../use";
|
|
101
|
+
/**
|
|
102
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
103
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
104
|
+
* @property {boolean} range 双滑块模式,默认值:false。
|
|
105
|
+
* @property {number | number[]} modelValue 滑块值,默认值:-。
|
|
106
|
+
* @property {number} min 最小值,默认值:0。
|
|
107
|
+
* @property {number} max 最大值,默认值:100。
|
|
108
|
+
* @property {number} step 步长,默认值:1。
|
|
109
|
+
* @property {boolean} vertical 垂直方向滑块,默认值:false。
|
|
110
|
+
* @property {boolean} disabled 禁用状态,默认值:false。
|
|
111
|
+
* @property {boolean} readonly 只读状态,默认值:false。
|
|
112
|
+
* @property {string} pieceColor 滑块间的轨道颜色,默认值:-。
|
|
113
|
+
* @property {string} trackColor 滑块轨道颜色,默认值:-。
|
|
114
|
+
* @property {string} trackSize 滑块轨道尺寸,默认值:-。
|
|
115
|
+
* @property {string} thumbColor 滑块颜色,默认值:-。
|
|
116
|
+
* @property {string} thumbSize 滑块尺寸,默认值:-。
|
|
117
|
+
* @property {boolean} showValue 是否显示值,默认值:false。
|
|
118
|
+
* @property {'top' | 'right' | 'bottom' | 'left'} valuePosition 值显示的位置,默认值:'top' / 'right'。
|
|
119
|
+
* @property {string} valueBackground 设置值的背景色,默认值:-。
|
|
120
|
+
* @property {string} valueColor 设置值的字体颜色,默认值:-。
|
|
121
|
+
* @property {boolean} showScale 是否显示刻度,默认值:false。
|
|
122
|
+
* @property {'top' | 'right' | 'bottom' | 'left'} scalePosition 刻度显示的位置,默认值:'bottom' / 'left'。
|
|
123
|
+
* @property {boolean} validateEvent 是否触发表单验证,默认值:true。
|
|
124
|
+
* @event {(value: number | number[]) => void} update 滑块值实时改变时触发
|
|
125
|
+
* @event {(value: number | number[]) => void} input 滑块值实时改变时触发
|
|
126
|
+
* @event {(value: number | number[]) => void} change 滑块点击或拖动结束且值改变时触发
|
|
127
|
+
* @event {(event: TouchEvent) => void} drag-start 开始拖动时触发
|
|
128
|
+
* @event {(event: TouchEvent) => void} drag-end 结束拖动时触发
|
|
129
|
+
*/
|
|
101
130
|
export default _defineComponent({
|
|
102
131
|
...{
|
|
103
132
|
options: {
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Space
|
|
4
|
+
subtitle: 间距
|
|
5
|
+
group: 布局
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
设置组件之间的间距。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Space from 'sard-uniapp/components/space/space.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
最基础的用法,通过间距组件来给组件之间提供统一的间距。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/space/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 垂直布局
|
|
27
|
+
|
|
28
|
+
使用 `direction` 来控制布局的方式, 背后实际上是利用了 `flex-direction` 来控制。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/space/demo/Vertical.vue')
|
|
31
|
+
|
|
32
|
+
### 间距大小
|
|
33
|
+
|
|
34
|
+
通过调整 `size` 的值来控制间距的大小。
|
|
35
|
+
|
|
36
|
+
使用内置的 `small、middle、large` 来设置间距大小。
|
|
37
|
+
|
|
38
|
+
@code('${DEMO_PATH}/space/demo/Size.vue')
|
|
39
|
+
|
|
40
|
+
### 自定义间距大小
|
|
41
|
+
|
|
42
|
+
很多时候,内建的大小不满足设计师的要求,我们可以通过传入自己定义的大小来设置。
|
|
43
|
+
|
|
44
|
+
@code('${DEMO_PATH}/space/demo/CustomSize.vue')
|
|
45
|
+
|
|
46
|
+
### 自动换行
|
|
47
|
+
|
|
48
|
+
在 `horizontal` 模式下,通过使用 `wrap` 来控制自动换行行为。
|
|
49
|
+
|
|
50
|
+
@code('${DEMO_PATH}/space/demo/Wrap.vue')
|
|
51
|
+
|
|
52
|
+
### 对齐
|
|
53
|
+
|
|
54
|
+
设置该值可以调整所有子节点在容器内的对齐方式,可设置的值与 `align-items` 一致。
|
|
55
|
+
|
|
56
|
+
@code('${DEMO_PATH}/space/demo/Align.vue')
|
|
57
|
+
|
|
58
|
+
## API
|
|
59
|
+
|
|
60
|
+
### SpaceProps
|
|
61
|
+
|
|
62
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
63
|
+
| -------------------------- | ---------------- | ---------------------------------------------------------------- | ------------ |
|
|
64
|
+
| root-class | 组件根元素类名 | string | - |
|
|
65
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
66
|
+
| direction | 排列的方向 | 'vertical' \| 'horizontal' | 'horizontal' |
|
|
67
|
+
| size | 间隔大小 | 'small' \| 'middle' \| 'large' \| string | 'middle' |
|
|
68
|
+
| align | 垂直排布方式 | 'start' \| 'end' \| 'center' \| 'baseline' | - |
|
|
69
|
+
| justify <sup>1.14.2+</sup> | 水平排布方式 | 'start' \| 'end' \| 'center' \| 'between'\| 'around' \| 'evenly' | - |
|
|
70
|
+
| wrap | 设置是否自动折行 | boolean | false |
|
|
71
|
+
|
|
72
|
+
### SpaceSlots
|
|
73
|
+
|
|
74
|
+
| 插槽 | 描述 | 属性 |
|
|
75
|
+
| ------- | -------------- | ---- |
|
|
76
|
+
| default | 自定义默认内容 | - |
|
|
77
|
+
|
|
78
|
+
## 主题定制
|
|
79
|
+
|
|
80
|
+
### CSS 变量
|
|
81
|
+
|
|
82
|
+
@code('./variables.scss#variables')
|
|
@@ -14,6 +14,15 @@ import {
|
|
|
14
14
|
spaceMapJustify,
|
|
15
15
|
spaceSizes
|
|
16
16
|
} from "./common";
|
|
17
|
+
/**
|
|
18
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
19
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
20
|
+
* @property {'vertical' | 'horizontal'} direction 排列的方向,默认值:'horizontal'。
|
|
21
|
+
* @property {'small' | 'middle' | 'large' | string} size 间隔大小,默认值:'middle'。
|
|
22
|
+
* @property {'start' | 'end' | 'center' | 'baseline'} align 垂直排布方式,默认值:-。
|
|
23
|
+
* @property {'start' | 'end' | 'center' | 'between'| 'around' | 'evenly'} justify 水平排布方式,默认值:-。
|
|
24
|
+
* @property {boolean} wrap 设置是否自动折行,默认值:false。
|
|
25
|
+
*/
|
|
17
26
|
export default _defineComponent({
|
|
18
27
|
...{
|
|
19
28
|
options: {
|