@ray-js/smart-ui 2.13.2-beta-0 → 2.13.2-beta-2

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.
Files changed (103) hide show
  1. package/es/@types/config-provider/index.d.ts +6 -2
  2. package/es/@types/config-provider/theme-vars.d.ts +1 -1
  3. package/es/action-sheet/README.md +613 -0
  4. package/es/battery/README.md +149 -0
  5. package/es/bottom-sheet/README.md +495 -0
  6. package/es/button/README.md +335 -0
  7. package/es/calendar/README.md +513 -0
  8. package/es/cascader/README.md +326 -0
  9. package/es/cell/README.md +317 -0
  10. package/es/checkbox/README.md +481 -0
  11. package/es/circle/README.md +132 -0
  12. package/es/col/README.md +162 -0
  13. package/es/collapse/README.md +127 -0
  14. package/es/config-provider/README.md +150 -0
  15. package/es/count-down/README.md +201 -0
  16. package/es/custom-keyboard/README.md +122 -0
  17. package/es/datetime-picker/README.md +438 -0
  18. package/es/dialog/README.md +451 -0
  19. package/es/divider/README.md +132 -0
  20. package/es/dropdown-menu/README.md +331 -0
  21. package/es/empty/README.md +119 -0
  22. package/es/field/README.md +455 -0
  23. package/es/grid/README.md +273 -0
  24. package/es/icon/README.md +178 -0
  25. package/es/image/README.md +225 -0
  26. package/es/index-bar/README.md +186 -0
  27. package/es/loading/README.md +120 -0
  28. package/es/nav-bar/README.md +410 -0
  29. package/es/notice-bar/README.md +274 -0
  30. package/es/notify/README.md +121 -0
  31. package/es/overlay/README.md +128 -0
  32. package/es/picker/README.md +412 -0
  33. package/es/popover/README.md +338 -0
  34. package/es/popup/README.md +272 -0
  35. package/es/progress/README.md +88 -0
  36. package/es/radio/README.md +423 -0
  37. package/es/rate/README.md +248 -0
  38. package/es/search/README.md +290 -0
  39. package/es/sidebar/README.md +176 -0
  40. package/es/skeleton/README.md +141 -0
  41. package/es/slider/README.md +444 -0
  42. package/es/stepper/README.md +231 -0
  43. package/es/sticky/README.md +91 -0
  44. package/es/swipe-cell/README.md +217 -0
  45. package/es/switch/README.md +316 -0
  46. package/es/tab/README.md +501 -0
  47. package/es/tabbar/README.md +397 -0
  48. package/es/tag/README.md +215 -0
  49. package/es/toast/README.md +293 -0
  50. package/es/transition/README.md +140 -0
  51. package/es/tree-select/README.md +348 -0
  52. package/lib/@types/config-provider/index.d.ts +6 -2
  53. package/lib/@types/config-provider/theme-vars.d.ts +1 -1
  54. package/lib/action-sheet/README.md +613 -0
  55. package/lib/battery/README.md +149 -0
  56. package/lib/bottom-sheet/README.md +495 -0
  57. package/lib/button/README.md +335 -0
  58. package/lib/calendar/README.md +513 -0
  59. package/lib/cascader/README.md +326 -0
  60. package/lib/cell/README.md +317 -0
  61. package/lib/checkbox/README.md +481 -0
  62. package/lib/circle/README.md +132 -0
  63. package/lib/col/README.md +162 -0
  64. package/lib/collapse/README.md +127 -0
  65. package/lib/config-provider/README.md +150 -0
  66. package/lib/count-down/README.md +201 -0
  67. package/lib/custom-keyboard/README.md +122 -0
  68. package/lib/datetime-picker/README.md +438 -0
  69. package/lib/dialog/README.md +451 -0
  70. package/lib/divider/README.md +132 -0
  71. package/lib/dropdown-menu/README.md +331 -0
  72. package/lib/empty/README.md +119 -0
  73. package/lib/field/README.md +455 -0
  74. package/lib/grid/README.md +273 -0
  75. package/lib/icon/README.md +178 -0
  76. package/lib/image/README.md +225 -0
  77. package/lib/index-bar/README.md +186 -0
  78. package/lib/loading/README.md +120 -0
  79. package/lib/nav-bar/README.md +410 -0
  80. package/lib/notice-bar/README.md +274 -0
  81. package/lib/notify/README.md +121 -0
  82. package/lib/overlay/README.md +128 -0
  83. package/lib/picker/README.md +412 -0
  84. package/lib/popover/README.md +338 -0
  85. package/lib/popup/README.md +272 -0
  86. package/lib/progress/README.md +88 -0
  87. package/lib/radio/README.md +423 -0
  88. package/lib/rate/README.md +248 -0
  89. package/lib/search/README.md +290 -0
  90. package/lib/sidebar/README.md +176 -0
  91. package/lib/skeleton/README.md +141 -0
  92. package/lib/slider/README.md +444 -0
  93. package/lib/stepper/README.md +231 -0
  94. package/lib/sticky/README.md +91 -0
  95. package/lib/swipe-cell/README.md +217 -0
  96. package/lib/switch/README.md +316 -0
  97. package/lib/tab/README.md +501 -0
  98. package/lib/tabbar/README.md +397 -0
  99. package/lib/tag/README.md +215 -0
  100. package/lib/toast/README.md +293 -0
  101. package/lib/transition/README.md +140 -0
  102. package/lib/tree-select/README.md +348 -0
  103. package/package.json +3 -3
@@ -0,0 +1,91 @@
1
+ ---
2
+ category: 布局
3
+ ---
4
+
5
+ # Sticky 粘性布局
6
+
7
+ ### 介绍
8
+
9
+ Sticky 组件与 CSS 中`position: sticky`属性实现的效果一致,当组件在屏幕范围内时,会按照正常的布局排列,当组件滚出屏幕范围时,始终会固定在屏幕顶部。
10
+
11
+ ### 引入
12
+
13
+ ```jsx
14
+ import { Sticky } from '@ray-js/smart-ui';
15
+ ```
16
+
17
+ ## 代码演示
18
+
19
+ ### 基础用法
20
+
21
+ 将内容包裹在`Sticky`组件内即可。
22
+
23
+ ```jsx
24
+ import { Sticky, Button } from '@ray-js/smart-ui';
25
+ import React from 'react';
26
+
27
+ export default function Demo() {
28
+ return (
29
+ <Sticky>
30
+ <Button type="primary">基础用法</Button>
31
+ </Sticky>
32
+ );
33
+ }
34
+ ```
35
+
36
+ ### 吸顶距离
37
+
38
+ 通过`offsetTop`属性可以设置组件在吸顶时与顶部的距离。
39
+
40
+ ```jsx
41
+ import { Sticky, Button } from '@ray-js/smart-ui';
42
+ import React from 'react';
43
+
44
+ export default function Demo() {
45
+ return (
46
+ <Sticky offsetTop={50}>
47
+ <Button customStyle={{ marginLeft: '115px' }} type="info">基础用法</Button>
48
+ </Sticky>
49
+ );
50
+ }
51
+ ```
52
+
53
+ ### 指定容器
54
+
55
+ 通过`container`属性可以指定组件的容器,页面滚动时,组件会始终保持在容器范围内,当组件即将超出容器底部时,会返回原位置。
56
+
57
+ ```jsx
58
+ import { Sticky, Button } from '@ray-js/smart-ui';
59
+ import { View, createSelectorQuery } from '@ray-js/ray';
60
+ import React from 'react';
61
+
62
+ export default function Demo() {
63
+ const container = () => createSelectorQuery().select('#container');
64
+ return (
65
+ <View id="container">
66
+ <Sticky container={container}>
67
+ <Button customStyle={{ marginLeft: '215px' }} type="warning">
68
+ 指定容器
69
+ </Button>
70
+ </Sticky>
71
+ </View>
72
+ );
73
+ }
74
+ ```
75
+
76
+ ## API
77
+
78
+ ### Props
79
+
80
+ | 参数 | 说明 | 类型 | 默认值 |
81
+ | ---------- | ------------------------------------------------------------ | ---------- | ------ |
82
+ | container | 一个函数,返回容器对应的 NodesRef 节点 | _function_ | - |
83
+ | offsetTop | 吸顶时与顶部的距离,单位`px` | _number_ | `0` |
84
+ | scrollTop | 当前滚动区域的滚动位置,非 `null` 时会禁用页面滚动事件的监听 | _number_ | - |
85
+ | zIndex | 吸顶时的 z-index | _number_ | `99` |
86
+
87
+ ### Events
88
+
89
+ | 事件名 | 说明 | 回调参数 |
90
+ | ----------- | ---------- | ---------------------------------------------- |
91
+ | onScroll | 滚动时触发 | { scrollTop: 距离顶部位置, isFixed: 是否吸顶 } |
@@ -0,0 +1,217 @@
1
+ ---
2
+ category: 反馈
3
+ ---
4
+
5
+ # SwipeCell 滑动单元格
6
+
7
+ ### 介绍
8
+
9
+ 可以左右滑动来展示操作按钮的单元格组件。
10
+
11
+ ### 引入
12
+
13
+ ```jsx
14
+ import { SwipeCell } from '@ray-js/smart-ui';
15
+ ```
16
+
17
+ ## 代码演示
18
+
19
+ ### 基础用法
20
+ `onTabClose` `v2.7.0` 属性是侧边栏关闭时触发的回调事件
21
+
22
+
23
+ ```jsx
24
+ import React, { useCallback } from 'react';
25
+ import { SwipeCell, CellGroup, Cell, SmartEventHandler, SmartSwipeCellPosition } from '@ray-js/smart-ui';
26
+ import { View } from '@ray-js/ray';
27
+
28
+ const style = {
29
+ display: 'flex',
30
+ width: '65px',
31
+ height: '100%',
32
+ fontSize: '15px',
33
+ color: '#fff',
34
+ backgroundColor: '#ee0a24',
35
+ justifyContent: 'center',
36
+ alignItems: 'center',
37
+ };
38
+
39
+ export default function Demo() {
40
+
41
+ const onHandleTabClose: SmartEventHandler<SmartSwipeCellPosition> = event => {
42
+ console.log(event.detail, '--position');
43
+ };
44
+ return (
45
+ <SwipeCell
46
+ rightWidth={65}
47
+ leftWidth={65}
48
+ slot={{
49
+ left: <View style={style}>选择</View>,
50
+ right: <View style={style}>删除</View>,
51
+ }}
52
+ onTabClose={onHandleTabClose}
53
+ >
54
+ <CellGroup>
55
+ <Cell title="单元格" value="内容" />
56
+ </CellGroup>
57
+ </SwipeCell>
58
+ );
59
+ }
60
+ ```
61
+
62
+ ### 异步关闭
63
+
64
+ 当开启`async-close`时, 通过绑定`close`事件,可以自定义两侧滑动内容点击时的关闭行为。
65
+
66
+ ```jsx
67
+ import React, { useCallback } from 'react';
68
+ import { SwipeCell, CellGroup, Cell, Dialog, DialogInstance } from '@ray-js/smart-ui';
69
+ import { View } from '@ray-js/ray';
70
+
71
+ const style = {
72
+ display: 'flex',
73
+ width: '65px',
74
+ height: '100%',
75
+ fontSize: '15px',
76
+ color: '#fff',
77
+ backgroundColor: '#ee0a24',
78
+ justifyContent: 'center',
79
+ alignItems: 'center',
80
+ } as React.CSSProperties
81
+
82
+ export default function Demo() {
83
+ const handleClose = useCallback(event => {
84
+ const { position, instance } = event.detail;
85
+ switch (position) {
86
+ case 'left':
87
+ case 'cell':
88
+ instance.close();
89
+ break;
90
+ case 'right':
91
+ DialogInstance.confirm({
92
+ context: this,
93
+ message: '确定删除吗?',
94
+ }).then(() => {
95
+ instance.close();
96
+ });
97
+ break;
98
+ default:
99
+ }
100
+ }, []);
101
+ return (
102
+ <>
103
+ <SwipeCell
104
+ rightWidth={65}
105
+ leftWidth={65}
106
+ slot={{
107
+ left: <View style={style}>选择</View>,
108
+ right: <View style={style}>删除</View>,
109
+ }}
110
+ asyncClose
111
+ onClose={handleClose}
112
+ >
113
+ <CellGroup>
114
+ <Cell title="单元格" value="内容" />
115
+ </CellGroup>
116
+ </SwipeCell>
117
+ <Dialog id="smart-dialog" />
118
+ </>
119
+ );
120
+ }
121
+ ```
122
+
123
+ ### 提示被打开
124
+
125
+ ```jsx
126
+ import React, { useCallback } from 'react';
127
+ import { SwipeCell, CellGroup, Cell, Notify, NotifyInstance } from '@ray-js/smart-ui';
128
+ import { View } from '@ray-js/ray';
129
+
130
+ export default function Demo() {
131
+ const handleOpen = useCallback(event => {
132
+ const { position, name } = event.detail;
133
+ switch (position) {
134
+ case 'left':
135
+ NotifyInstance({
136
+ context: this,
137
+ type: 'primary',
138
+ message: `${name}${position}部分展示open事件被触发`,
139
+ });
140
+ break;
141
+ case 'right':
142
+ NotifyInstance({
143
+ context: this,
144
+ type: 'primary',
145
+ message: `${name}${position}部分展示open事件被触发`,
146
+ });
147
+ break;
148
+ default:
149
+ }
150
+ }, []);
151
+ return (
152
+ <>
153
+ <SwipeCell
154
+ id="swipe-cell"
155
+ rightWidth={65}
156
+ leftWidth={65}
157
+ slot={{
158
+ left: <View className={styles.left}>选择</View>,
159
+ right: <View className={styles.right}>删除</View>,
160
+ }}
161
+ onOpen={handleOpen}
162
+ >
163
+ <CellGroup>
164
+ <Cell title="单元格" value="内容" />
165
+ </CellGroup>
166
+ </SwipeCell>
167
+ <Notify id="smart-notify" />
168
+ </>
169
+ );
170
+ }
171
+ ```
172
+
173
+ ## API
174
+
175
+ ### Props
176
+
177
+ | 参数 | 说明 | 类型 | 默认值 |
178
+ | ----------- | --------------------------------------- | ------------------ | ------- |
179
+ | asyncClose | 是否异步关闭 | _boolean_ | `false` |
180
+ | disabled | 是否禁用滑动 | _boolean_ | `false` |
181
+ | leftWidth | 左侧滑动区域宽度 | _number_ | `0` |
182
+ | name | 标识符,可以在 close 事件的参数中获取到 | _string \| number_ | - |
183
+ | rightWidth | 右侧滑动区域宽度 | _number_ | `0` |
184
+
185
+ ### Slot
186
+
187
+ | 名称 | 说明 |
188
+ | ----- | -------------- |
189
+ | - | 自定义显示内容 |
190
+ | left | 左侧滑动内容 |
191
+ | right | 右侧滑动内容 |
192
+
193
+ ### Events
194
+
195
+ | 事件名 | 说明 | 参数 |
196
+ | ---------- | ---------- | --------------------------------------------------------- |
197
+ | onClick | 点击时触发 | 关闭时的点击位置 (`left` `right` `cell` `outside`) |
198
+ | onTabClose `v2.7.0` | 关闭时触发 | 关闭的位置 (`left` `right`) |
199
+ | onClose | 点击异步关闭时触发 | { position: 'left' \| 'right' , instance , name: string } |
200
+ | onOpen | 打开时触发 | { position: 'left' \| 'right' , name: string } |
201
+
202
+ ### close 参数
203
+
204
+ | 参数 | 类型 | 说明 |
205
+ | -------- | -------- | -------------------------------------------------- |
206
+ | instance | _object_ | SwipeCell 实例 |
207
+ | name | 标识符 | _string_ |
208
+ | position | _string_ | 关闭时的点击位置 (`left` `right` `cell` `outside`) |
209
+
210
+ ### 方法
211
+
212
+ 通过 [selectComponent](/material/smartui?comId=faq) 可以获取到 SwipeCell 实例并调用实例方法
213
+
214
+ | 方法名 | 参数 | 返回值 | 介绍 |
215
+ | ------ | ------------------------- | ------ | ---------------- |
216
+ | close | - | - | 收起单元格侧边栏 |
217
+ | open | position: `left \| right` | - | 打开单元格侧边栏 |
@@ -0,0 +1,316 @@
1
+ ---
2
+ category: 反馈
3
+ ---
4
+
5
+ # Switch 开关
6
+
7
+ ### 介绍
8
+
9
+ 简单易用的开关组件
10
+
11
+ ### 引入
12
+
13
+ ```jsx
14
+ import { Switch } from '@ray-js/smart-ui';
15
+ ```
16
+
17
+ ## 代码演示
18
+
19
+ ### 基础用法
20
+
21
+ ```jsx
22
+ import { Switch } from '@ray-js/smart-ui';
23
+ import React from 'react';
24
+
25
+ export default function Demo() {
26
+ const [value, onChange] = React.useState(true);
27
+
28
+ return (
29
+ <>
30
+ <Switch
31
+ checked={value}
32
+ onChange={event => {
33
+ onChange(event.detail);
34
+ }}
35
+ />
36
+ <Switch
37
+ checked={!value}
38
+ onChange={event => {
39
+ onChange(event.detail);
40
+ }}
41
+ />
42
+ </>
43
+ );
44
+ }
45
+ ```
46
+
47
+ ### 开关文案 `v2.7.0`
48
+
49
+ ```jsx
50
+ import { Switch } from '@ray-js/smart-ui';
51
+ import React from 'react';
52
+
53
+ export default function Demo() {
54
+ const [value, onChange] = React.useState(true);
55
+
56
+ return (
57
+ <>
58
+ <Switch
59
+ checked={value}
60
+ activeText="开"
61
+ inactiveText="关"
62
+ onChange={event => {
63
+ onChange(event.detail);
64
+ }}
65
+ />
66
+ <ConfigProvider
67
+ themeVars={{
68
+ switchLabelFontSize: '10px',
69
+ }}
70
+ >
71
+ <Switch
72
+ checked={value}
73
+ activeText="展示"
74
+ inactiveText="隐藏"
75
+ onChange={event => {
76
+ onChange(event.detail);
77
+ }}
78
+ />
79
+ </ConfigProvider>
80
+ </>
81
+ );
82
+ }
83
+ ```
84
+
85
+
86
+ ### 禁用
87
+
88
+ ```jsx
89
+ import { Switch } from '@ray-js/smart-ui';
90
+ import React from 'react';
91
+
92
+ export default function Demo() {
93
+ const [value, onChange] = React.useState(true);
94
+
95
+ return (
96
+ <Switch
97
+ checked={value}
98
+ disabled
99
+ />
100
+ );
101
+ }
102
+ ```
103
+
104
+ ### 加载
105
+
106
+ ```jsx
107
+ import { Switch } from '@ray-js/smart-ui';
108
+ import React from 'react';
109
+
110
+ export default function Demo() {
111
+ const [value, onChange] = React.useState(true);
112
+
113
+ return (
114
+ <Switch
115
+ checked={value}
116
+ loading
117
+ />
118
+ );
119
+ }
120
+ ```
121
+
122
+ ### 自定义大小
123
+
124
+ `size` 属性可以设置组件的大小。
125
+
126
+ ```jsx
127
+ import { Switch } from '@ray-js/smart-ui';
128
+ import React from 'react';
129
+
130
+ export default function Demo() {
131
+ const [value, onChange] = React.useState(true);
132
+
133
+ return (
134
+ <Switch
135
+ checked={value}
136
+ size="24px"
137
+ />
138
+ );
139
+ }
140
+ ```
141
+
142
+ ### 自定义颜色
143
+
144
+ 设置 `activeColor` 可以设置选择后的颜色,`inactiveColor` 可以设置非选择后的颜色
145
+
146
+ ```jsx
147
+ import { Switch } from '@ray-js/smart-ui';
148
+ import React from 'react';
149
+
150
+ export default function Demo() {
151
+ const [value, onChange] = React.useState(true);
152
+
153
+ return (
154
+ <Switch
155
+ checked={value}
156
+ activeColor="#07c160"
157
+ inactiveColor="#ee0a24"
158
+ />
159
+ );
160
+ }
161
+ ```
162
+
163
+ ### 渐变色 `v2.5.0`
164
+
165
+ 所有 CSS background 可以实现的属性, `activeColor` 和 `inactiveColor` 都可以实现
166
+
167
+ ```jsx
168
+ import { Switch } from '@ray-js/smart-ui';
169
+ import React from 'react';
170
+
171
+ export default function Demo() {
172
+ const [value, onChange] = React.useState(true);
173
+
174
+ return (
175
+ <Switch
176
+ checked={value}
177
+ activeColor="linear-gradient(to right, #ff7e5f, #987AFF)"
178
+ inactiveColor="linear-gradient(to right, #407e5f, #841AFF)"
179
+ />
180
+ );
181
+ }
182
+ ```
183
+
184
+ ### 异步控制
185
+
186
+ ```jsx
187
+ import { Switch, DialogInstance, Dialog } from '@ray-js/smart-ui';
188
+ import React from 'react';
189
+
190
+ export default function Demo() {
191
+ const [value, setValue] = React.useState(true);
192
+
193
+ const onChange = ({ detail }) => {
194
+ DialogInstance.confirm({
195
+ context: this,
196
+ title: '提示',
197
+ message: '是否切换开关?',
198
+ }).then(() => {
199
+ setValue(detail);
200
+ });
201
+ };
202
+
203
+ return (
204
+ <>
205
+ <Switch
206
+ checked={value}
207
+ onChange={onChange}
208
+ />
209
+ <Dialog id="smart-dialog" />
210
+ </>
211
+ );
212
+ }
213
+ ```
214
+
215
+ ### 阻止冒泡
216
+
217
+ `stopClickPropagation` 属性可以阻止冒泡。
218
+
219
+ ```jsx
220
+ import { Switch } from '@ray-js/smart-ui';
221
+ import React from 'react';
222
+
223
+ export default function Demo() {
224
+ const [value, onChange] = React.useState(true);
225
+
226
+ return (
227
+ <Switch
228
+ checked={value}
229
+ stopClickPropagation
230
+ onChange={event => {
231
+ onChange(event.detail);
232
+ }}
233
+ />
234
+ );
235
+ }
236
+ ```
237
+
238
+ ### 列表用法
239
+
240
+ ```jsx
241
+ import { Switch, Cell, CellGroup } from '@ray-js/smart-ui';
242
+ import React from 'react';
243
+
244
+ export default function Demo() {
245
+ const [value, onChange] = React.useState(true);
246
+
247
+ return (
248
+ <CellGroup>
249
+ <Cell title="标题">
250
+ <Switch
251
+ checked={value}
252
+ onChange={event => {
253
+ onChange(event.detail);
254
+ }}
255
+ />
256
+ </Cell>
257
+ </CellGroup>
258
+ );
259
+ }
260
+ ```
261
+
262
+ ## API
263
+
264
+ ### Props
265
+
266
+ | 参数 | 说明 | 类型 | 默认值 |
267
+ | ------------------------------- | ---------------------- | --------- | --------- |
268
+ | activeColor | 打开时的背景色 | _string_ | `#1989fa` |
269
+ | activeValue | 打开时的值 | _any_ | `true` |
270
+ | checked | 开关选中状态 | _any_ | `false` |
271
+ | disabled | 是否为禁用状态 | _boolean_ | `false` |
272
+ | inactiveColor | 关闭时的背景色 | _string_ | `#fff` |
273
+ | inactiveValue | 关闭时的值 | _any_ | `false` |
274
+ | loading | 是否为加载状态 | _boolean_ | `false` |
275
+ | name | 在表单内提交时的标识符 | _string_ | - |
276
+ | size | 开关尺寸 | _string_ | `30px` |
277
+ | stopClickPropagation `v1.0.2` | 是否阻止冒泡 | _boolean_ | `false` |
278
+ | activeText `v2.7.0` | 打开时的文案 | _string_ | - |
279
+ | inactiveText `v2.7.0` | 关闭时的文案 | _string_ | - |
280
+
281
+ ### Events
282
+
283
+ | 事件名 | 说明 | 参数 |
284
+ | ----------- | ---------------- | -------------------------- |
285
+ | onChange | 开关状态切换回调 | event.detail: 是否选中开关 |
286
+
287
+ ### 外部样式类
288
+
289
+ | 类名 | 说明 |
290
+ | ------------ | ------------ |
291
+ | customClass | 根节点样式类 |
292
+ | nodeClass | 圆点样式类 |
293
+
294
+ ### 样式变量
295
+
296
+ 组件提供了下列 CSS 变量,可用于自定义样式,使用方法请参考 [ConfigProvider 组件](/material/smartui?comId=config-provider)。
297
+
298
+ | 名称 | 默认值 | 描述 |
299
+ | ----------------------------- | -------------------------------------- | ---- |
300
+ | --switch-width | _1.5338em_ | 开关宽度 |
301
+ | --switch-height | _0.867em_ | 开关高度 |
302
+ | --switch-node-size | _0.867em_ | 开关节点大小 |
303
+ | --switch-node-z-index | _1_ | 开关节点层级 |
304
+ | --switch-node-background-color | _#fff_ | - |
305
+ | --switch-node-box-shadow | _0 3px 1px 0 rgba(0, 0, 0, 0.05),_ | 开关节点阴影 |
306
+ | --switch-background-color | _var(--app-B4-N6, rgba(0, 0, 0, 0.2))_ | 开关背景颜色 |
307
+ | --switch-on-background-color | _#1989fa_ | 开关开启时背景颜色 |
308
+ | --switch-transition-duration | _0.3s_ | 开关过渡持续时间 |
309
+ | --switch-disabled-opacity | _0.4_ | 开关禁用时不透明度 |
310
+ | --switch-border `@deprecated v2.5.0` | _0.08em solid rgba(0, 0, 0, 0.1)_ | 开关边框 |
311
+ | --switch-node-on-background-color `v2.4.0` | _var(--switch-node-background-color, #fff)_ | 开启时圆球的背景色 |
312
+ | --switch-padding `v2.5.0` | _0.08em_ | 内部边距 |
313
+ | --switch-label-width `v2.7.0` | _2em_ | 文本开关时的默认宽度 |
314
+ | --switch-label-font-size `v2.7.0` | _12px_ | 文字大小 |
315
+ | --switch-label-active-color `v2.7.0` | _var(--app-B3, #ffffff)_ `v2.7.0` _#FFFFFF_ `v2.8.0` | 开时文字颜色 |
316
+ | --switch-label-inactive-color `v2.7.0` | _var(--app-B3, #ffffff)_ `v2.7.0` _#FFFFFF_ `v2.8.0` | 关时文字颜色 |