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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type IconProps } from './common';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<IconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<IconProps> & Readonly<{}>, {
|
|
3
|
+
separate: boolean;
|
|
3
4
|
name: string;
|
|
4
5
|
family: string;
|
|
5
6
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/components/icon/icon.vue
CHANGED
|
@@ -9,6 +9,15 @@ import { mergeDefaults as _mergeDefaults, defineComponent as _defineComponent }
|
|
|
9
9
|
import { computed } from "vue";
|
|
10
10
|
import { classNames, stringifyStyle, isFileUrl, createBem } from "../../utils";
|
|
11
11
|
import { defaultIconProps } from "./common";
|
|
12
|
+
/**
|
|
13
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
14
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
15
|
+
* @property {string} name 图标名称或图片链接,如果名称带有`/`,会被认为是图片图标,默认值:''。
|
|
16
|
+
* @property {string} family 字体名称,默认值:'sari'。
|
|
17
|
+
* @property {string} size 图标大小,默认值:-。
|
|
18
|
+
* @property {string} color 图标颜色,默认值:-。
|
|
19
|
+
* @property {boolean} separate 是否分开字体和字体名称,而不进行拼接,默认值:false。
|
|
20
|
+
*/
|
|
12
21
|
export default _defineComponent({
|
|
13
22
|
...{
|
|
14
23
|
options: {
|
|
@@ -23,7 +32,8 @@ export default _defineComponent({
|
|
|
23
32
|
name: { type: String, required: false },
|
|
24
33
|
family: { type: String, required: false },
|
|
25
34
|
size: { type: String, required: false },
|
|
26
|
-
color: { type: String, required: false }
|
|
35
|
+
color: { type: String, required: false },
|
|
36
|
+
separate: { type: Boolean, required: false }
|
|
27
37
|
}, defaultIconProps),
|
|
28
38
|
setup(__props, { expose: __expose }) {
|
|
29
39
|
__expose();
|
|
@@ -38,12 +48,17 @@ export default _defineComponent({
|
|
|
38
48
|
}
|
|
39
49
|
if (props.name.includes(":")) {
|
|
40
50
|
const [family, name] = props.name.split(":");
|
|
41
|
-
return classNames(
|
|
51
|
+
return classNames(
|
|
52
|
+
bem.b(),
|
|
53
|
+
family,
|
|
54
|
+
props.separate && family !== "sari" ? name : `${family}-${name}`,
|
|
55
|
+
props.rootClass
|
|
56
|
+
);
|
|
42
57
|
}
|
|
43
58
|
return classNames(
|
|
44
59
|
bem.b(),
|
|
45
60
|
props.family,
|
|
46
|
-
`${props.family}-${props.name}`,
|
|
61
|
+
props.separate && props.family !== "sari" ? props.name : `${props.family}-${props.name}`,
|
|
47
62
|
props.rootClass
|
|
48
63
|
);
|
|
49
64
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Indexes
|
|
4
|
+
subtitle: 索引
|
|
5
|
+
group: 导航组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
用于页面中信息快速检索,可以根据目录中的页码快速找到所需的内容。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Indexes from 'sard-uniapp/components/indexes/indexes.vue'
|
|
16
|
+
import IndexesAnchor from 'sard-uniapp/components/indexes-anchor/indexes-anchor.vue'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 代码演示
|
|
20
|
+
|
|
21
|
+
### 基础使用
|
|
22
|
+
|
|
23
|
+
`Indexes` 里面的 `IndexesAnchor` 组件会被收集起来,用于放置锚点和自动生成右侧的导航。导航和锚点会有一个联动效果。
|
|
24
|
+
|
|
25
|
+
@code('${DEMO_PATH}/indexes/demo/Basic.vue')
|
|
26
|
+
|
|
27
|
+
`AreaCode.vue`
|
|
28
|
+
|
|
29
|
+
@code('${DEMO_PATH}/indexes/demo/AreaCode.vue')
|
|
30
|
+
|
|
31
|
+
`AreaCodeSearch.vue`
|
|
32
|
+
|
|
33
|
+
@code('${DEMO_PATH}/indexes/demo/AreaCodeSearch.vue')
|
|
34
|
+
|
|
35
|
+
## API
|
|
36
|
+
|
|
37
|
+
### IndexesProps
|
|
38
|
+
|
|
39
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
40
|
+
| ---------- | ------------------ | ---------------- | ------ |
|
|
41
|
+
| root-class | 组件根元素类名 | string | - |
|
|
42
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
43
|
+
| current | 设置当前活动的锚点 | number \| string | - |
|
|
44
|
+
|
|
45
|
+
### IndexesSlots
|
|
46
|
+
|
|
47
|
+
| 插槽 | 描述 | 属性 |
|
|
48
|
+
| ------- | -------------- | ---- |
|
|
49
|
+
| default | 自定义默认内容 | - |
|
|
50
|
+
|
|
51
|
+
### IndexesEmits
|
|
52
|
+
|
|
53
|
+
| 事件 | 描述 | 类型 |
|
|
54
|
+
| ------------------------------- | ------------------ | -------------------------------- |
|
|
55
|
+
| update:current <sup>1.12+</sup> | 索引发生变更时触发 | (name: number \| string) => void |
|
|
56
|
+
| change | 索引发生变更时触发 | (name: number \| string) => void |
|
|
57
|
+
|
|
58
|
+
### IndexesExpose
|
|
59
|
+
|
|
60
|
+
| 属性 | 描述 | 类型 |
|
|
61
|
+
| -------- | -------------- | -------------------------------- |
|
|
62
|
+
| scrollTo | 滚动到指定锚点 | (name: string \| number) => void |
|
|
63
|
+
| update | 更新锚点位置 | () => void |
|
|
64
|
+
|
|
65
|
+
### IndexesAnchorProps
|
|
66
|
+
|
|
67
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
68
|
+
| ---------- | -------------- | ---------------- | ------ |
|
|
69
|
+
| root-class | 组件根元素类名 | string | - |
|
|
70
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
71
|
+
| name | 索引锚点名称 | number \| string | - |
|
|
72
|
+
|
|
73
|
+
### IndexesAnchorSlots
|
|
74
|
+
|
|
75
|
+
| 插槽 | 描述 | 属性 |
|
|
76
|
+
| ------- | ---------------------------------- | ---- |
|
|
77
|
+
| default | 自定义锚点内容,会覆盖 `name` 属性 | - |
|
|
78
|
+
|
|
79
|
+
## 主题定制
|
|
80
|
+
|
|
81
|
+
### CSS 变量
|
|
82
|
+
|
|
83
|
+
@code('./variables.scss#variables')
|
|
@@ -42,6 +42,13 @@ import {
|
|
|
42
42
|
} from "./common";
|
|
43
43
|
import { useScrollSpy } from "../../use";
|
|
44
44
|
import SarIndexesNav from "../indexes-nav/indexes-nav.vue";
|
|
45
|
+
/**
|
|
46
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
47
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
48
|
+
* @property {number | string} current 设置当前活动的锚点,默认值:-。
|
|
49
|
+
* @event {(name: number | string) => void} update 索引发生变更时触发
|
|
50
|
+
* @event {(name: number | string) => void} change 索引发生变更时触发
|
|
51
|
+
*/
|
|
45
52
|
export default _defineComponent({
|
|
46
53
|
components: {
|
|
47
54
|
SarIndexesNav,
|
|
@@ -20,6 +20,11 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
indexesContextSymbol
|
|
22
22
|
} from "../indexes/common";
|
|
23
|
+
/**
|
|
24
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
25
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
26
|
+
* @property {number | string} name 索引锚点名称,默认值:-。
|
|
27
|
+
*/
|
|
23
28
|
export default _defineComponent({
|
|
24
29
|
...{
|
|
25
30
|
options: {
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Input
|
|
4
|
+
subtitle: 输入框
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
接收用户输入的文本信息。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Input from 'sard-uniapp/components/input/input.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 基础使用
|
|
21
|
+
|
|
22
|
+
可以通过 `v-model` 绑定输入框的值,通过 `placeholder` 设置占位提示文字。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/input/demo/Basic.vue')
|
|
25
|
+
|
|
26
|
+
### 自定义样式
|
|
27
|
+
|
|
28
|
+
可以对其尺寸、颜色、背景色、边框等样式进行设置。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/input/demo/Style.vue')
|
|
31
|
+
|
|
32
|
+
### 类型
|
|
33
|
+
|
|
34
|
+
据 `type` 属性定义不同类型的输入框,默认值为 `text。`
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/input/demo/Type.vue')
|
|
37
|
+
|
|
38
|
+
### 可清除的
|
|
39
|
+
|
|
40
|
+
设置了 `clearable` 属性后,在输入框有值时会显示清除按钮。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/input/demo/Clearable.vue')
|
|
43
|
+
|
|
44
|
+
### 聚焦时显示清除按钮
|
|
45
|
+
|
|
46
|
+
只在输入框获取焦点时显示清除按钮。
|
|
47
|
+
|
|
48
|
+
@code('${DEMO_PATH}/input/demo/ShowClearOnlyFocus.vue')
|
|
49
|
+
|
|
50
|
+
### 只读和禁用
|
|
51
|
+
|
|
52
|
+
只读或禁用时无法输入。
|
|
53
|
+
|
|
54
|
+
@code('${DEMO_PATH}/input/demo/DisabledReadOnly.vue')
|
|
55
|
+
|
|
56
|
+
### 插槽
|
|
57
|
+
|
|
58
|
+
可以通过前置或后置插槽添加额外的内容。
|
|
59
|
+
|
|
60
|
+
@code('${DEMO_PATH}/input/demo/Slot.vue')
|
|
61
|
+
|
|
62
|
+
### 去除边框
|
|
63
|
+
|
|
64
|
+
清除边框后页面看起来会很清爽。
|
|
65
|
+
|
|
66
|
+
@code('${DEMO_PATH}/input/demo/Borderless.vue')
|
|
67
|
+
|
|
68
|
+
### 嵌入的
|
|
69
|
+
|
|
70
|
+
`inlaid` 用于清除边框和内边距,以便可以嵌入到其他组件内。
|
|
71
|
+
|
|
72
|
+
@code('${DEMO_PATH}/input/demo/Inlaid.vue')
|
|
73
|
+
|
|
74
|
+
### 多行文本
|
|
75
|
+
|
|
76
|
+
设置 `type="textarea"` 可以换行输入。
|
|
77
|
+
|
|
78
|
+
@code('${DEMO_PATH}/input/demo/Multiple.vue')
|
|
79
|
+
|
|
80
|
+
### 自动高度
|
|
81
|
+
|
|
82
|
+
设置自动高度可以让文本域随输入内容变多而增高。
|
|
83
|
+
另外可以设置 `minHeight` 设置文本域的最小高度。
|
|
84
|
+
|
|
85
|
+
@code('${DEMO_PATH}/input/demo/AutoHeight.vue')
|
|
86
|
+
|
|
87
|
+
### 字数提示
|
|
88
|
+
|
|
89
|
+
设置 `showCount` 属性可以显示当前输入的字数和总字数;
|
|
90
|
+
设置 `maxlength` 可以限制输入的最大字数。
|
|
91
|
+
|
|
92
|
+
@code('${DEMO_PATH}/input/demo/ShowCount.vue')
|
|
93
|
+
|
|
94
|
+
## API
|
|
95
|
+
|
|
96
|
+
### InputProps
|
|
97
|
+
|
|
98
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
99
|
+
| ------------------------- | ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------- | ------ |
|
|
100
|
+
| root-class | 组件根元素类名 | string | - |
|
|
101
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
102
|
+
| model-value (v-model) | 输入框值 | string \| number | - |
|
|
103
|
+
| clearable | 是否显示清空按钮 | boolean | false |
|
|
104
|
+
| show-clear-only-focus | 是否只在聚焦时显示清空按钮 | boolean | false |
|
|
105
|
+
| show-count | 是否展示字数 | boolean | false |
|
|
106
|
+
| inlaid | 嵌入式状态 | boolean | false |
|
|
107
|
+
| borderless | 是否隐藏边框 | boolean | false |
|
|
108
|
+
| readonly | 只读状态 | boolean | false |
|
|
109
|
+
| focused | 是否显示获焦样式,用于结合自定义键盘使用时显示高亮效果 | boolean | false |
|
|
110
|
+
| min-height | 输入框最小高度 | string | - |
|
|
111
|
+
| placeholder | 输入框占位符内容 | string | - |
|
|
112
|
+
| placeholder-style | 输入框占位符样式 | string | - |
|
|
113
|
+
| placeholder-class | 输入框占位符类名 | string | - |
|
|
114
|
+
| disabled | 禁用状态 | boolean | false |
|
|
115
|
+
| maxlength | 最大输入长度,设置为 -1 的时候不限制最大长度 | number | 140 |
|
|
116
|
+
| focus | 获取焦点 | boolean | - |
|
|
117
|
+
| cursor-spacing | 指定光标与键盘的距离 | number | 30 |
|
|
118
|
+
| cursor | 指定 focus 时的光标位置 | number | -1 |
|
|
119
|
+
| confirm-type | 设置键盘右下角按钮的文字 | "send" \| "search" \| "next" \| "go" \| "done" | 'done' |
|
|
120
|
+
| confirm-hold | 点击键盘右下角按钮时是否保持键盘不收起 | boolean | false |
|
|
121
|
+
| selection-start | 光标起始位置 | number | -1 |
|
|
122
|
+
| selection-end | 光标结束位置 | number | -1 |
|
|
123
|
+
| adjust-position | 键盘弹起时,是否自动上推页面 | boolean | true |
|
|
124
|
+
| hold-keyboard | focus 时,点击页面的时候不收起键盘 | boolean | false |
|
|
125
|
+
| auto-blur | 键盘收起时,是否自动失去焦点 | boolean | false |
|
|
126
|
+
| ignore-composition-event | 是否忽略组件内对文本合成系统事件的处理 | boolean | true |
|
|
127
|
+
| inputmode | 用户在编辑元素或其内容时可能输入的数据类型的提示 | 'none' \| 'text' \| 'decimal' \| 'numeric' \| 'tel' \| 'search' \| 'email' \| 'url' | 'text' |
|
|
128
|
+
| auto-height | 文本域自动高度 | boolean | false |
|
|
129
|
+
| fixed | 如果 `textarea` 是在一个 `position:fixed` 的区域,需要显示指定属性 `fixed` 为 `true` | boolean | false |
|
|
130
|
+
| show-confirm-bar | 是否显示键盘上方带有”完成“按钮那一栏 | boolean | true |
|
|
131
|
+
| disable-default-padding | 是否去掉 iOS 下的默认内边距 | boolean | false |
|
|
132
|
+
| type | 输入框类型 | 'text' \| 'password' \| 'textarea' \| 'number' \|'idcard' \| 'digit' \| 'tel' \| 'safe-password' \| 'nickname' | 'text' |
|
|
133
|
+
| always-embed | 强制 input 处于同层状态 | boolean | - |
|
|
134
|
+
| safe-password-cert-path | 安全键盘加密公钥的路径,只支持包内路径 | string | - |
|
|
135
|
+
| safe-password-length | 安全键盘输入密码长度 | number | - |
|
|
136
|
+
| safe-password-time-stamp | 安全键盘加密时间戳 | number | - |
|
|
137
|
+
| safe-password-nonce | 安全键盘加密盐值 | string | - |
|
|
138
|
+
| safe-password-salt | 安全键盘计算 `hash` 盐值,若指定 `custom-hash` 则无效 | string | - |
|
|
139
|
+
| safe-password-custom-hash | 安全键盘计算 `hash` 的算法表达式 | string | - |
|
|
140
|
+
| random-number | 当 `type` 为 `number, digit, idcard` 数字键盘是否随机排列 | boolean | false |
|
|
141
|
+
| controlled | 是否为受控组件。为 `true` 时,value 内容会完全受 `setData` 控制 | boolean | false |
|
|
142
|
+
| always-system | 是否强制使用系统键盘和 `Web-view `创建的 `input` 元素 | boolean | false |
|
|
143
|
+
| validate-event | 是否触发表单验证 | boolean | true |
|
|
144
|
+
|
|
145
|
+
### InputSlots
|
|
146
|
+
|
|
147
|
+
| 插槽 | 描述 | 属性 |
|
|
148
|
+
| ------- | -------------------- | ---- |
|
|
149
|
+
| prepend | 自定义输入框前面内容 | - |
|
|
150
|
+
| append | 自定义输入框后面内容 | - |
|
|
151
|
+
|
|
152
|
+
### InputEmits
|
|
153
|
+
|
|
154
|
+
| 事件 | 描述 | 类型 |
|
|
155
|
+
| ------------------------ | ------------------------------ | ----------------------- |
|
|
156
|
+
| update:model-value | 输入框值改变时触发 | (value: string) => void |
|
|
157
|
+
| input <sup>1.9.2+</sup> | 输入框值改变时触发 | (value: string) => void |
|
|
158
|
+
| change <sup>1.9.2+</sup> | 键盘非聚焦状态且内容改变时触发 | (value: string) => void |
|
|
159
|
+
| clear | 点击清除按钮时触发 | () => void |
|
|
160
|
+
| focus | 聚焦时触发 | (event: any) => void |
|
|
161
|
+
| blur | 失焦时触发 | (event: any) => void |
|
|
162
|
+
| linechange | 输入框行数变化时触发 | (event: any) => void |
|
|
163
|
+
| confirm | 点击完成时触发 | (event: any) => void |
|
|
164
|
+
| keyboardheightchange | 键盘高度发生变化的时候触发 | (event: any) => void |
|
|
165
|
+
|
|
166
|
+
## 主题定制
|
|
167
|
+
|
|
168
|
+
### CSS 变量
|
|
169
|
+
|
|
170
|
+
@code('./variables.scss#variables')
|
|
@@ -67,26 +67,6 @@
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
@include e(placeholder) {
|
|
71
|
-
color: var(--sar-input-placeholder-color);
|
|
72
|
-
font-size: var(--sar-input-control-font-size);
|
|
73
|
-
line-height: var(--sar-input-control-line-height);
|
|
74
|
-
|
|
75
|
-
@include m(textarea) {
|
|
76
|
-
position: absolute;
|
|
77
|
-
top: 0;
|
|
78
|
-
left: 0;
|
|
79
|
-
right: 0;
|
|
80
|
-
bottom: 0;
|
|
81
|
-
overflow: hidden;
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@include m(input-min-height) {
|
|
86
|
-
line-height: var(--sar-input-control-input-height);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
70
|
@include e(prepend, append) {
|
|
91
71
|
@include universal;
|
|
92
72
|
align-items: center;
|
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="inputClass" :style="inputStyle" @click="onClick">
|
|
3
3
|
<view :class="bem.e('content')">
|
|
4
|
-
<view v-if="$slots.prepend" :class="bem.e('prepend')">
|
|
5
|
-
<slot name="prepend"></slot>
|
|
6
|
-
</view>
|
|
7
4
|
<view
|
|
8
|
-
v-if="
|
|
9
|
-
:class="
|
|
10
|
-
classNames(
|
|
11
|
-
bem.e('placeholder'),
|
|
12
|
-
bem.em('placeholder', 'textarea'),
|
|
13
|
-
bem.em('placeholder', 'input-min-height', inputMinHeight),
|
|
14
|
-
placeholderClass,
|
|
15
|
-
)
|
|
16
|
-
"
|
|
17
|
-
:style="mergedPlaceholderStyle"
|
|
5
|
+
v-if="internalPrepend !== 0 && $slots.prepend"
|
|
6
|
+
:class="bem.e('prepend')"
|
|
18
7
|
>
|
|
19
|
-
|
|
8
|
+
<slot name="prepend"></slot>
|
|
20
9
|
</view>
|
|
21
10
|
<textarea
|
|
22
11
|
v-if="type === 'textarea'"
|
|
@@ -27,6 +16,9 @@
|
|
|
27
16
|
bem.em('control', 'input-min-height', inputMinHeight),
|
|
28
17
|
)
|
|
29
18
|
"
|
|
19
|
+
:placeholder="placeholder"
|
|
20
|
+
:placeholder-style="mergedPlaceholderStyle"
|
|
21
|
+
:placeholder-class="placeholderClass"
|
|
30
22
|
:value="innerValue"
|
|
31
23
|
:disabled="isDisabled || isReadonly"
|
|
32
24
|
:maxlength="maxlength"
|
|
@@ -62,7 +54,7 @@
|
|
|
62
54
|
:value="innerValue"
|
|
63
55
|
:placeholder="placeholder"
|
|
64
56
|
:placeholder-style="mergedPlaceholderStyle"
|
|
65
|
-
:placeholder-class="
|
|
57
|
+
:placeholder-class="placeholderClass"
|
|
66
58
|
:disabled="isDisabled || isReadonly"
|
|
67
59
|
:maxlength="maxlength"
|
|
68
60
|
:focus="focus"
|
|
@@ -127,6 +119,61 @@ import { useFormContext, useFormItemContext } from "../form/common";
|
|
|
127
119
|
import {
|
|
128
120
|
defaultInputProps
|
|
129
121
|
} from "./common";
|
|
122
|
+
/**
|
|
123
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
124
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
125
|
+
* @property {string | number} modelValue 输入框值,默认值:-。
|
|
126
|
+
* @property {boolean} clearable 是否显示清空按钮,默认值:false。
|
|
127
|
+
* @property {boolean} showClearOnlyFocus 是否只在聚焦时显示清空按钮,默认值:false。
|
|
128
|
+
* @property {boolean} showCount 是否展示字数,默认值:false。
|
|
129
|
+
* @property {boolean} inlaid 嵌入式状态,默认值:false。
|
|
130
|
+
* @property {boolean} borderless 是否隐藏边框,默认值:false。
|
|
131
|
+
* @property {boolean} readonly 只读状态,默认值:false。
|
|
132
|
+
* @property {boolean} focused 是否显示获焦样式,用于结合自定义键盘使用时显示高亮效果,默认值:false。
|
|
133
|
+
* @property {string} minHeight 输入框最小高度,默认值:-。
|
|
134
|
+
* @property {string} placeholder 输入框占位符内容,默认值:-。
|
|
135
|
+
* @property {string} placeholderStyle 输入框占位符样式,默认值:-。
|
|
136
|
+
* @property {string} placeholderClass 输入框占位符类名,默认值:-。
|
|
137
|
+
* @property {boolean} disabled 禁用状态,默认值:false。
|
|
138
|
+
* @property {number} maxlength 最大输入长度,设置为 -1 的时候不限制最大长度,默认值:140。
|
|
139
|
+
* @property {boolean} focus 获取焦点,默认值:-。
|
|
140
|
+
* @property {number} cursorSpacing 指定光标与键盘的距离,默认值:30。
|
|
141
|
+
* @property {number} cursor 指定 focus 时的光标位置,默认值:-1。
|
|
142
|
+
* @property {"send" | "search" | "next" | "go" | "done"} confirmType 设置键盘右下角按钮的文字,默认值:'done'。
|
|
143
|
+
* @property {boolean} confirmHold 点击键盘右下角按钮时是否保持键盘不收起,默认值:false。
|
|
144
|
+
* @property {number} selectionStart 光标起始位置,默认值:-1。
|
|
145
|
+
* @property {number} selectionEnd 光标结束位置,默认值:-1。
|
|
146
|
+
* @property {boolean} adjustPosition 键盘弹起时,是否自动上推页面,默认值:true。
|
|
147
|
+
* @property {boolean} holdKeyboard focus 时,点击页面的时候不收起键盘,默认值:false。
|
|
148
|
+
* @property {boolean} autoBlur 键盘收起时,是否自动失去焦点,默认值:false。
|
|
149
|
+
* @property {boolean} ignoreCompositionEvent 是否忽略组件内对文本合成系统事件的处理,默认值:true。
|
|
150
|
+
* @property {'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url'} inputmode 用户在编辑元素或其内容时可能输入的数据类型的提示,默认值:'text'。
|
|
151
|
+
* @property {boolean} autoHeight 文本域自动高度,默认值:false。
|
|
152
|
+
* @property {boolean} fixed 如果 `textarea` 是在一个 `position:fixed` 的区域,需要显示指定属性 `fixed` 为 `true`,默认值:false。
|
|
153
|
+
* @property {boolean} showConfirmBar 是否显示键盘上方带有”完成“按钮那一栏,默认值:true。
|
|
154
|
+
* @property {boolean} disableDefaultPadding 是否去掉 iOS 下的默认内边距,默认值:false。
|
|
155
|
+
* @property {'text' | 'password' | 'textarea' | 'number' |'idcard' | 'digit' | 'tel' | 'safe-password' | 'nickname'} type 输入框类型,默认值:'text'。
|
|
156
|
+
* @property {boolean} alwaysEmbed 强制 input 处于同层状态,默认值:-。
|
|
157
|
+
* @property {string} safePasswordCertPath 安全键盘加密公钥的路径,只支持包内路径,默认值:-。
|
|
158
|
+
* @property {number} safePasswordLength 安全键盘输入密码长度,默认值:-。
|
|
159
|
+
* @property {number} safePasswordTimeStamp 安全键盘加密时间戳,默认值:-。
|
|
160
|
+
* @property {string} safePasswordNonce 安全键盘加密盐值,默认值:-。
|
|
161
|
+
* @property {string} safePasswordSalt 安全键盘计算 `hash` 盐值,若指定 `custom-hash` 则无效,默认值:-。
|
|
162
|
+
* @property {string} safePasswordCustomHash 安全键盘计算 `hash` 的算法表达式,默认值:-。
|
|
163
|
+
* @property {boolean} randomNumber 当 `type` 为 `number, digit, idcard` 数字键盘是否随机排列,默认值:false。
|
|
164
|
+
* @property {boolean} controlled 是否为受控组件。为 `true` 时,value 内容会完全受 `setData` 控制,默认值:false。
|
|
165
|
+
* @property {boolean} alwaysSystem 是否强制使用系统键盘和 `Web-view `创建的 `input` 元素,默认值:false。
|
|
166
|
+
* @property {boolean} validateEvent 是否触发表单验证,默认值:true。
|
|
167
|
+
* @event {(value: string) => void} update 输入框值改变时触发
|
|
168
|
+
* @event {(value: string) => void} input 输入框值改变时触发
|
|
169
|
+
* @event {(value: string) => void} change 键盘非聚焦状态且内容改变时触发
|
|
170
|
+
* @event {() => void} clear 点击清除按钮时触发
|
|
171
|
+
* @event {(event: any) => void} focus 聚焦时触发
|
|
172
|
+
* @event {(event: any) => void} blur 失焦时触发
|
|
173
|
+
* @event {(event: any) => void} linechange 输入框行数变化时触发
|
|
174
|
+
* @event {(event: any) => void} confirm 点击完成时触发
|
|
175
|
+
* @event {(event: any) => void} keyboardheightchange 键盘高度发生变化的时候触发
|
|
176
|
+
*/
|
|
130
177
|
export default _defineComponent({
|
|
131
178
|
components: {
|
|
132
179
|
SarIcon,
|
|
@@ -183,7 +230,8 @@ export default _defineComponent({
|
|
|
183
230
|
readonly: { type: Boolean, required: false },
|
|
184
231
|
focused: { type: Boolean, required: false },
|
|
185
232
|
minHeight: { type: String, required: false },
|
|
186
|
-
validateEvent: { type: Boolean, required: false }
|
|
233
|
+
validateEvent: { type: Boolean, required: false },
|
|
234
|
+
internalPrepend: { type: Number, required: false }
|
|
187
235
|
}, defaultInputProps),
|
|
188
236
|
emits: ["update:model-value", "change", "input", "clear", "focus", "blur", "linechange", "confirm", "keyboardheightchange", "click"],
|
|
189
237
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -302,8 +350,14 @@ export default _defineComponent({
|
|
|
302
350
|
const mergedPlaceholderStyle = computed(() => {
|
|
303
351
|
return stringifyStyle(
|
|
304
352
|
{
|
|
305
|
-
color: "var(--sar-input-placeholder-color)"
|
|
353
|
+
color: "var(--sar-input-placeholder-color)",
|
|
354
|
+
fontSize: "var(--sar-input-control-font-size)",
|
|
355
|
+
lineHeight: "var(--sar-input-control-line-height)"
|
|
306
356
|
},
|
|
357
|
+
props.inputMinHeight ? {
|
|
358
|
+
minHeight: "var(--sar-input-control-input-height)",
|
|
359
|
+
lineHeight: "var(--sar-input-control-input-height)"
|
|
360
|
+
} : null,
|
|
307
361
|
props.placeholderStyle
|
|
308
362
|
);
|
|
309
363
|
});
|
|
@@ -15,7 +15,7 @@ page,
|
|
|
15
15
|
--sar-input-control-line-height: var(--sar-leading-normal);
|
|
16
16
|
--sar-input-control-textarea-height: 168rpx;
|
|
17
17
|
|
|
18
|
-
--sar-input-placeholder-color: var(--sar-
|
|
18
|
+
--sar-input-placeholder-color: var(--sar-fourth-color);
|
|
19
19
|
|
|
20
20
|
--sar-input-prepend-margin-right: 16rpx;
|
|
21
21
|
--sar-input-append-margin-left: 16rpx;
|
|
@@ -23,7 +23,7 @@ page,
|
|
|
23
23
|
--sar-input-clear-margin-right: calc(var(--sar-input-padding-x) * -1);
|
|
24
24
|
--sar-input-clear-padding-x: 16rpx;
|
|
25
25
|
--sar-input-clear-font-size: 32rpx;
|
|
26
|
-
--sar-input-clear-color: var(--sar-
|
|
26
|
+
--sar-input-clear-color: var(--sar-fourth-color);
|
|
27
27
|
|
|
28
28
|
--sar-input-count-font-size: var(--sar-text-sm);
|
|
29
29
|
--sar-input-count-line-height: var(--sar-leading-tight);
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav: 组件
|
|
3
|
+
title: Keyboard
|
|
4
|
+
subtitle: 键盘
|
|
5
|
+
group: 表单组件
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 介绍
|
|
9
|
+
|
|
10
|
+
虚拟键盘,用于输入支付密码、验证码、车牌号等场景。
|
|
11
|
+
|
|
12
|
+
## 引入
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import Keyboard from 'sard-uniapp/components/keyboard/keyboard.vue'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 代码演示
|
|
19
|
+
|
|
20
|
+
### 数字键盘
|
|
21
|
+
|
|
22
|
+
展示 0-9 的数字按键和删除按键。
|
|
23
|
+
|
|
24
|
+
@code('${DEMO_PATH}/keyboard/demo/Number.vue')
|
|
25
|
+
|
|
26
|
+
### 带小数点的数字键盘
|
|
27
|
+
|
|
28
|
+
允许输入小数。
|
|
29
|
+
|
|
30
|
+
@code('${DEMO_PATH}/keyboard/demo/Digit.vue')
|
|
31
|
+
|
|
32
|
+
### 身份证键盘
|
|
33
|
+
|
|
34
|
+
由 0-9 和 X 组成。
|
|
35
|
+
|
|
36
|
+
@code('${DEMO_PATH}/keyboard/demo/Idcard.vue')
|
|
37
|
+
|
|
38
|
+
### 随机数字键盘
|
|
39
|
+
|
|
40
|
+
展示乱序的数字按键。
|
|
41
|
+
|
|
42
|
+
@code('${DEMO_PATH}/keyboard/demo/Random.vue')
|
|
43
|
+
|
|
44
|
+
### 车牌号键盘
|
|
45
|
+
|
|
46
|
+
用于输入车牌号。
|
|
47
|
+
|
|
48
|
+
@code('${DEMO_PATH}/keyboard/demo/Plate.vue')
|
|
49
|
+
|
|
50
|
+
## API
|
|
51
|
+
|
|
52
|
+
### KeyboardProps
|
|
53
|
+
|
|
54
|
+
| 属性 | 描述 | 类型 | 默认值 |
|
|
55
|
+
| ---------- | -------------- | ------------------------------------------------------ | -------- |
|
|
56
|
+
| root-class | 组件根元素类名 | string | - |
|
|
57
|
+
| root-style | 组件根元素样式 | StyleValue | - |
|
|
58
|
+
| type | 键盘类型 | 'number' \| 'digit' \| 'idcard' \| 'random' \| 'plate' | 'number' |
|
|
59
|
+
|
|
60
|
+
### KeyboardEmits
|
|
61
|
+
|
|
62
|
+
| 事件 | 描述 | 类型 |
|
|
63
|
+
| ------ | -------------------- | --------------------- |
|
|
64
|
+
| input | 可输入按键点击时触发 | (key: string) => void |
|
|
65
|
+
| delete | 点击删除按钮时触发 | () => void |
|
|
66
|
+
|
|
67
|
+
### KeyBoardExpose
|
|
68
|
+
|
|
69
|
+
| 属性 | 描述 | 类型 |
|
|
70
|
+
| ------- | ---------------------- | ---------- |
|
|
71
|
+
| shuffle | 重新打乱随机键盘按键 | () => void |
|
|
72
|
+
| toggle | 切换车牌号的中英文按键 | () => void |
|
|
73
|
+
|
|
74
|
+
## 主题定制
|
|
75
|
+
|
|
76
|
+
### CSS 变量
|
|
77
|
+
|
|
78
|
+
@code('./variables.scss#variables')
|
|
79
|
+
|
|
80
|
+
### CSS 变量 - 暗黑模式
|
|
81
|
+
|
|
82
|
+
@code('./variables-dark.scss#variables')
|
|
@@ -117,6 +117,13 @@ import {
|
|
|
117
117
|
defaultKeyboardProps
|
|
118
118
|
} from "./common";
|
|
119
119
|
import SarIcon from "../icon/icon.vue";
|
|
120
|
+
/**
|
|
121
|
+
* @property {string} rootClass 组件根元素类名,默认值:-。
|
|
122
|
+
* @property {StyleValue} rootStyle 组件根元素样式,默认值:-。
|
|
123
|
+
* @property {'number' | 'digit' | 'idcard' | 'random' | 'plate'} type 键盘类型,默认值:'number'。
|
|
124
|
+
* @event {(key: string) => void} input 可输入按键点击时触发
|
|
125
|
+
* @event {() => void} delete 点击删除按钮时触发
|
|
126
|
+
*/
|
|
120
127
|
export default _defineComponent({
|
|
121
128
|
components: {
|
|
122
129
|
SarIcon,
|