@canlooks/can-ui 0.0.90 → 0.0.92

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 (76) hide show
  1. package/dist/cjs/components/calendar/calendar.style.js +124 -124
  2. package/dist/cjs/components/clickAway/clickAway.d.ts +1 -1
  3. package/dist/cjs/components/status/status.d.ts +6 -6
  4. package/dist/cjs/components/tree/tree.style.d.ts +1 -0
  5. package/dist/cjs/components/tree/tree.style.js +7 -4
  6. package/dist/cjs/components/tree/treeDnd.js +10 -1
  7. package/dist/cjs/components/tree/treeNode.js +7 -2
  8. package/dist/cjs/components/treeSelect/treeSelect.js +1 -1
  9. package/dist/esm/components/calendar/calendar.style.js +124 -124
  10. package/dist/esm/components/clickAway/clickAway.d.ts +1 -1
  11. package/dist/esm/components/status/status.d.ts +6 -6
  12. package/dist/esm/components/tree/tree.style.d.ts +1 -0
  13. package/dist/esm/components/tree/tree.style.js +7 -4
  14. package/dist/esm/components/tree/treeDnd.js +11 -2
  15. package/dist/esm/components/tree/treeNode.js +7 -2
  16. package/dist/esm/components/treeSelect/treeSelect.js +1 -1
  17. package/documentation/dist/assets/index-DvrKS6Tv.js +7747 -0
  18. package/documentation/dist/atom-one-dark.min.css +1 -0
  19. package/documentation/dist/components/accordion.md +38 -0
  20. package/documentation/dist/components/actionSheet.md +49 -0
  21. package/documentation/dist/components/alert.md +38 -0
  22. package/documentation/dist/components/anchorList.md +36 -0
  23. package/documentation/dist/components/autocomplete.md +68 -0
  24. package/documentation/dist/components/avatar.md +79 -0
  25. package/documentation/dist/components/badge.md +33 -0
  26. package/documentation/dist/components/bottomNavigation.md +39 -0
  27. package/documentation/dist/components/breadcrumb.md +28 -0
  28. package/documentation/dist/components/bubbleConfirm.md +34 -0
  29. package/documentation/dist/components/button.md +62 -0
  30. package/documentation/dist/components/card.md +30 -0
  31. package/documentation/dist/components/cascade.md +48 -0
  32. package/documentation/dist/components/checkbox.md +36 -0
  33. package/documentation/dist/components/colorPicker.md +27 -0
  34. package/documentation/dist/components/contextMenu.md +27 -0
  35. package/documentation/dist/components/counter.md +29 -0
  36. package/documentation/dist/components/dataGrid.md +112 -0
  37. package/documentation/dist/components/dateTimePicker.md +35 -0
  38. package/documentation/dist/components/dateTimeRangePicker.md +36 -0
  39. package/documentation/dist/components/descriptions.md +35 -0
  40. package/documentation/dist/components/dialog.md +56 -0
  41. package/documentation/dist/components/divider.md +26 -0
  42. package/documentation/dist/components/drawer.md +40 -0
  43. package/documentation/dist/components/flex.md +20 -0
  44. package/documentation/dist/components/form.md +131 -0
  45. package/documentation/dist/components/formDialog.md +36 -0
  46. package/documentation/dist/components/grid.md +34 -0
  47. package/documentation/dist/components/highlight.md +26 -0
  48. package/documentation/dist/components/image.md +90 -0
  49. package/documentation/dist/components/input.md +39 -0
  50. package/documentation/dist/components/loading.md +46 -0
  51. package/documentation/dist/components/menu.md +85 -0
  52. package/documentation/dist/components/pagination.md +38 -0
  53. package/documentation/dist/components/pickerDialog.md +56 -0
  54. package/documentation/dist/components/placeholder.md +30 -0
  55. package/documentation/dist/components/progress.md +43 -0
  56. package/documentation/dist/components/radio.md +37 -0
  57. package/documentation/dist/components/rating.md +35 -0
  58. package/documentation/dist/components/resizable.md +41 -0
  59. package/documentation/dist/components/scrollbar.md +31 -0
  60. package/documentation/dist/components/segmented.md +57 -0
  61. package/documentation/dist/components/select.md +30 -0
  62. package/documentation/dist/components/skeleton.md +26 -0
  63. package/documentation/dist/components/slidableActions.md +53 -0
  64. package/documentation/dist/guide/appComponent.md +30 -0
  65. package/documentation/dist/guide/globalMethods.md +238 -0
  66. package/documentation/dist/guide/icon.md +57 -0
  67. package/documentation/dist/guide/introduction.md +2 -0
  68. package/documentation/dist/guide/overrideProps.md +0 -0
  69. package/documentation/dist/guide/startup.md +23 -0
  70. package/documentation/dist/guide/theme.md +249 -0
  71. package/documentation/dist/index.html +13 -0
  72. package/documentation/dist/logo.png +0 -0
  73. package/extensions/curd.cjs +5 -5
  74. package/extensions/documentViewer.cjs +5 -5
  75. package/extensions/textFormatter.cjs +5 -5
  76. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ # Segmented 段落选择器
2
+
3
+ ## 示例
4
+
5
+ ```tsx
6
+ import {Segmented} from '@canlooks/can-ui'
7
+
8
+ export default function Index() {
9
+ return (
10
+ <Segmented
11
+ options={[
12
+ {
13
+ label: '选项1',
14
+ value: 1
15
+ },
16
+ {
17
+ label: '选项2',
18
+ value: 2
19
+ },
20
+ {
21
+ label: '选项3',
22
+ value: 3
23
+ }
24
+ ]}
25
+ defaultValue={1}
26
+ />
27
+ )
28
+ }
29
+ ```
30
+
31
+ ## SegmentedProps
32
+
33
+ | 属性 | 类型 | 默认值 | 说明 |
34
+ |----------------|------------------------------------------------------------------------|--------------------|----------------------|
35
+ | options | [SegmentedOptionProps](#SegmentedOptionProps)[] | - | |
36
+ | orientation | 'horizontal' \| 'vertical' | 'horizontal' | |
37
+ | size | 'small' \| 'medium' \| 'large' | 'medium' | |
38
+ | labelKey | string | 'label' | `option`中用做`label`的键 |
39
+ | primaryKey | string | 'value' | `option`中用做主键的键 |
40
+ | fullWidth | boolean | false | 是否占满整行 |
41
+ | indicatorColor | string | background.content | 指示器的颜色 |
42
+ | defaultValue | | - | |
43
+ | value | | - | |
44
+ | onChange | (value) => void | - | |
45
+ | readOnly | boolean | false | |
46
+ | disabled | boolean | false | |
47
+
48
+ ## SegmentedOptionProps
49
+
50
+ | 属性 | 类型 | 默认值 | 说明 |
51
+ |-------------|------------------------------------------------------------------------|-------|-------------|
52
+ | orientation | 'horizontal' \| 'vertical' | - | |
53
+ | prefix | ReactNode | - | 前缀,通常用于渲染图标 |
54
+ | suffix | ReactNode | - | 后缀 |
55
+ | value | string \| number | - | |
56
+ | label | ReactNode | - | |
57
+ | disabled | boolean | false | |
@@ -0,0 +1,30 @@
1
+ # Select 选择器
2
+
3
+ ## 示例
4
+
5
+ ```tsx
6
+ import {Select} from '@canlooks/can-ui'
7
+
8
+ export default function Index() {
9
+ return (
10
+ <Select
11
+ style={{width: 200}}
12
+ options={[
13
+ {
14
+ label: '选项1',
15
+ value: 1
16
+ },
17
+ {
18
+ label: '选项2',
19
+ value: 2
20
+ },
21
+ {
22
+ label: '选项3',
23
+ value: 3
24
+ }
25
+ ]}
26
+ defaultValue={1}
27
+ />
28
+ )
29
+ }
30
+ ```
@@ -0,0 +1,26 @@
1
+ # Skeleton 骨架屏
2
+
3
+ ## 示例
4
+
5
+ ```tsx
6
+ import {Flex, Skeleton} from '@canlooks/can-ui'
7
+
8
+ export default function Index() {
9
+ return (
10
+ <Flex width="100%" direction="column" gap={24}>
11
+ <Skeleton/>
12
+ <Skeleton.Card/>
13
+ <Skeleton.Table/>
14
+ </Flex>
15
+ )
16
+ }
17
+ ```
18
+
19
+ ## Props
20
+
21
+ | 属性 | 类型 | 默认值 | 说明 |
22
+ |-----------|------------------------------------------|-----------|-----------------|
23
+ | variant | 'circular' \| 'rectangular' \| 'rounded' | 'rounded' | |
24
+ | animation | boolean | true | 是否播放动画 |
25
+ | width | string \| number | - | 同`style.width` |
26
+ | height | string \| number | - | 同`style.height` |
@@ -0,0 +1,53 @@
1
+ # SlidableActions 滑动操作
2
+
3
+ ## 示例
4
+
5
+ ```tsx
6
+ import {SlidableActions} from '@canlooks/can-ui'
7
+
8
+ export default function Index() {
9
+ return (
10
+ <SlidableActions
11
+ style={{width: 400}}
12
+ leftActions={[
13
+ {
14
+ label: '操作1',
15
+ color: 'warning'
16
+ },
17
+ {
18
+ label: '操作2',
19
+ color: 'info'
20
+ }
21
+ ]}
22
+ rightActions={{
23
+ label: '删除',
24
+ color: 'error'
25
+ }}
26
+ >
27
+ <MenuItem label="左右滑动显示更多操作"/>
28
+ </SlidableActions>
29
+ )
30
+ }
31
+ ```
32
+
33
+ ## Props
34
+
35
+ | 属性 | 类型 | 默认值 | 说明 |
36
+ |------------------------|-------------------------------------------|------------|-----------------|
37
+ | leftActions | [ActionType](#ActionType) \| ActionType[] | - | |
38
+ | rightActions | ActionType \| ActionType[] | - | |
39
+ | autoReturn | boolean | true | 点击action后是否自动归位 |
40
+ | bounceElementTranslate | number | 12 | 元素弹性移动距离 |
41
+ | bounceDragDistance | number | 240 | 手指弹性拖拽距离 |
42
+ | effectiveSpeed | number | 450 (px/s) | 滑动生效的速度 |
43
+ | disabled | boolean | false | |
44
+
45
+ ## ActionType
46
+
47
+ | 属性 | 类型 | 默认值 | 说明 |
48
+ |-------------|-----------------------------------------|-----------|---------------------|
49
+ | color | string | 'default' | |
50
+ | label | ReactNode | - | |
51
+ | icon | ReactNode | - | |
52
+ | autoReturn | boolean | true | 点击当前action后是否自动归位 |
53
+ | buttonProps | [ButtonProps](/components/button#Props) | - | 传递至`<Button/>`组件的属性 |
@@ -0,0 +1,30 @@
1
+ # 入口组件
2
+
3
+ ## <App\/>
4
+
5
+ 通常使用`<App/>`组件作为入口组件,该组件定义了[全局方法](globalMethods)与顶层样式,也便于[自定义主题](theme)
6
+
7
+ 如果你使用`npx create-canlooks`脚手架程序创建项目,你会得到类似这样的代码:
8
+
9
+ ```tsx no-preview
10
+ import {App} from '@canlooks/can-ui'
11
+
12
+ export default function Root() {
13
+ return (
14
+ <App>
15
+ {/*your top component here*/}
16
+ </App>
17
+ )
18
+ }
19
+ ```
20
+
21
+ ## Props
22
+
23
+ `<App/>`组件继承了`<div/>`元素的所有属性,此外还有以下属性:
24
+
25
+ | 属性 | 类型 | 默认值 | 说明 |
26
+ |-----------|------------------------------|-------|----------------------------------------------|
27
+ | theme | [ThemeDefinition](theme) | - | 传递给[<ThemeProvider\/>](theme)组件的属性 |
28
+ | fill | boolean | true | <App\/>组件是否填满父元素,component为`null`或`false`时无效 |
29
+ | children | ReactNode | - | 子组件 |
30
+ | component | ElementType \| null \| false | 'div' | 使用特定的组件渲染,若指定为`null`或`false`则不会渲染组件 |
@@ -0,0 +1,238 @@
1
+ # 全局方法
2
+
3
+ ## App.dialog
4
+
5
+ - `App.dialog.info(props, [...args])`
6
+ - `App.dialog.success(props, [...args])`
7
+ - `App.dialog.warning(props, [...args])`
8
+ - `App.dialog.error(props, [...args])`
9
+ - `App.dialog.confirm(props, [...args])`
10
+
11
+ `args`会传递至`props.onConfirm`与`props.onCancel`回调中
12
+
13
+ ```tsx
14
+ import {App, Flex, Button} from '@canlooks/can-ui'
15
+
16
+ export default function Index() {
17
+ const onClick = async (type: 'info' | 'success' | 'warning' | 'error' | 'confirm') => {
18
+ await App.dialog[type]({
19
+ title: '对话框',
20
+ content: '这是一个对话框'
21
+ })
22
+ }
23
+
24
+ return (
25
+ <Flex gap={12} wrap="wrap">
26
+ <Button onClick={() => onClick('info')}>info</Button>
27
+ <Button onClick={() => onClick('success')}>success</Button>
28
+ <Button onClick={() => onClick('warning')}>warning</Button>
29
+ <Button onClick={() => onClick('error')}>error</Button>
30
+ <Button onClick={() => onClick('confirm')}>confirm</Button>
31
+ </Flex>
32
+ )
33
+ }
34
+ ```
35
+
36
+ ### dialog props
37
+
38
+ | 属性 | 类型 | 默认值 | 说明 |
39
+ |-------------------|--------------------------------------|--------------------------------------|----------------------------------------------------------------|
40
+ | icon | ReactNode | [<StatusIcon\/>](/components/status) | |
41
+ | title | ReactNode | | |
42
+ | footer | ReactNode | | |
43
+ | prefix | ReactNode | | |
44
+ | suffix | ReactNode | | |
45
+ | content | ReactNode | | |
46
+ | width | string \| number | 360 | 对话框的宽度 |
47
+ | minWidth | string \| number | | |
48
+ | maxWidth | string \| number | 100% | |
49
+ | showClose | boolean | | 是否显示关闭按钮 |
50
+ | closeProps | [ButtonProps](/components/button#Props) | | |
51
+ | showConfirm | boolean | true | 是否显示确定按钮 |
52
+ | confirmText | ReactNode | '确定' | |
53
+ | confirmProps | [ButtonProps](/components/button#Props) | | |
54
+ | onConfirm | (...args) => void | | |
55
+ | confirmLoading | boolean | | 确定按钮的加载状态 |
56
+ | showCancel | boolean | true | 取消按钮 |
57
+ | cancelText | ReactNode | '取消' | |
58
+ | cancelProps | [ButtonProps](/components/button#Props) | | |
59
+ | onCancel | (...args) => void | | |
60
+ | draggable | boolean | | 对话框是否可拖拽 |
61
+ | maskClosable | boolean | true | 是否可以点击遮罩层关闭 |
62
+ | onMaskClick | MouseEventHandler | | 点击遮罩层 |
63
+ | escapeClosable | boolean | false | 是否可以点击`ESC`关闭 |
64
+ | defaultOpen | boolean | | 打开状态 |
65
+ | open | boolean | | 受控的打开状态 |
66
+ | onOpened | () => void | 打开动画结束后 | |
67
+ | onClose | (closeReason: string) => void | | |
68
+ | onClosed | () => void | 关闭动画结束后 | |
69
+ | container | Element \| () => Element | document.body | 容器元素,自定义渲染在DOM树的位置 |
70
+ | forceRender | boolean | undefined | `true`-强制渲染<br>`false`-关闭后销毁<br/>`undeinfed`-第一次打开时渲染,后跟随父组件销毁 |
71
+ | singleLayer | boolean | true | 是否只显示一层遮罩 |
72
+ | removeFocusOnOpen | boolean | true | 打开时是否移除当前焦点 |
73
+ | modalProps | [ModalProps](/components/transition) | | 传递给`<Modal/>`组件属性 |
74
+ | maskProps | DOMAttributes | | 传递给遮罩层元素的属性 |
75
+
76
+ ---
77
+
78
+ ## App.message
79
+
80
+ - `App.message.info(content|props)`
81
+ - `App.message.success(content|props)`
82
+ - `App.message.warning(content|props)`
83
+ - `App.message.error(content|props)`
84
+
85
+ ```tsx
86
+ import {App, Flex, Button} from '@canlooks/can-ui'
87
+
88
+ export default function Index() {
89
+ const onClick = async (type: 'info' | 'success' | 'warning' | 'error') => {
90
+ await App.message[type]('这是一个消息框')
91
+ }
92
+
93
+ return (
94
+ <Flex gap={12} wrap="wrap">
95
+ <Button onClick={() => onClick('info')}>info</Button>
96
+ <Button onClick={() => onClick('success')}>success</Button>
97
+ <Button onClick={() => onClick('warning')}>warning</Button>
98
+ <Button onClick={() => onClick('error')}>error</Button>
99
+ </Flex>
100
+ )
101
+ }
102
+ ```
103
+
104
+ ### message props
105
+
106
+ | 属性 | 类型 | 默认值 | 说明 |
107
+ |--------------------|-------------------------|------------|----------|
108
+ | variant | 'filled' \| 'outlined' | 'outlined' | 弹框的样式 |
109
+ | color | string | 'primary' | |
110
+ | icon | ReactNode | | |
111
+ | title | ReactNode | | |
112
+ | content | ReactNode | | |
113
+ | showClose | boolean | false | 是否显示关闭按钮 |
114
+ | placement | string | 'top' | 弹框弹出的位置 |
115
+ | duration | number | 3000 | 关闭延迟 |
116
+ | onAutoClose | () => void | | 自动关闭时 |
117
+ | onCloseButtonClick | (e: MouseEvent) => void | | 点击关闭按钮时 |
118
+
119
+ ---
120
+
121
+ ## App.notification
122
+
123
+ - `App.message.notification(content|props)`
124
+ - `App.message.notification(content|props)`
125
+ - `App.message.notification(content|props)`
126
+ - `App.message.notification(content|props)`
127
+
128
+ ```tsx
129
+ import {App, Flex, Button} from '@canlooks/can-ui'
130
+
131
+ export default function Index() {
132
+ const onClick = async (type: 'info' | 'success' | 'warning' | 'error') => {
133
+ await App.notification[type]({
134
+ title: '通知',
135
+ content: '这是一个通知框'
136
+ })
137
+ }
138
+
139
+ return (
140
+ <Flex gap={12} wrap="wrap">
141
+ <Button onClick={() => onClick('info')}>info</Button>
142
+ <Button onClick={() => onClick('success')}>success</Button>
143
+ <Button onClick={() => onClick('warning')}>warning</Button>
144
+ <Button onClick={() => onClick('error')}>error</Button>
145
+ </Flex>
146
+ )
147
+ }
148
+ ```
149
+
150
+ ---
151
+
152
+ ### notification props
153
+
154
+ notification方法接受与[message](#message%20props)方法相同的属性
155
+
156
+ ---
157
+
158
+ ## App.actionSheet
159
+
160
+ - `App.actionSheet.confirm(title|props, [...args])`
161
+ - `App.actionSheet.open(props, [...args])`
162
+
163
+ ```tsx
164
+ import {App, Flex, Button} from '@canlooks/can-ui'
165
+
166
+ export default function Index() {
167
+ const onClick = async (type: 'confirm' | 'open') => {
168
+ const selected = await App.actionSheet[type]({
169
+ title: '弹出菜单',
170
+ actions: [
171
+ {label: '选项1'},
172
+ {label: '选项2'}
173
+ ]
174
+ })
175
+ }
176
+
177
+ return (
178
+ <Flex gap={12} wrap="wrap">
179
+ <Button onClick={() => onClick('confirm')}>confirm</Button>
180
+ <Button onClick={() => onClick('open')}>open</Button>
181
+ </Flex>
182
+ )
183
+ }
184
+ ```
185
+
186
+ ### actionSheet props
187
+
188
+ | 属性 | 类型 | 默认值 | 说明 |
189
+ |-------------------|--------------------------------------|---------------------------------------|----------------------------------------------------------------|
190
+ | title | ReactNode | | |
191
+ | actions | ReactNode | [MenuItemProps](/components/menuItem#MenuItemProps) | |
192
+ | placement | 'top' \| 'bottom' | 'bottom' | 菜单弹出的位置 |
193
+ | maskClosable | boolean | true | 是否可以点击遮罩层关闭 |
194
+ | escapeClosable | boolean | false | 是否可以点击`ESC`关闭 |
195
+ | onAction | (action) => void | | 点击选项 |
196
+ | onConfirm | (e: MouseEvent) => void | | 点击确定 |
197
+ | showConfirm | boolean | true | 是否显示确定选项,`actionSheet.confirm`方法有效 |
198
+ | confirmText | ReactNode | '确定' | |
199
+ | confirmProps | [ButtonProps](/components/button#Props) | | |
200
+ | showCancel | boolean | true | 是否显示取消选项,`actionSheet.confirm`方法有效 |
201
+ | cancelText | ReactNode | '取消' | |
202
+ | cancelProps | [ButtonProps](/components/button#Props) | | |
203
+ | onCancel | (e: MouseEvent) => void | | 点击取消 |
204
+ | defaultOpen | boolean | | 打开状态 |
205
+ | open | boolean | | 受控的打开状态 |
206
+ | onOpened | () => void | 打开动画结束后 | |
207
+ | onClose | (closeReason: string) => void | | |
208
+ | onClosed | () => void | 关闭动画结束后 | |
209
+ | container | Element \| () => Element | document.body | 容器元素,自定义渲染在DOM树的位置 |
210
+ | forceRender | boolean | undefined | `true`-强制渲染<br>`false`-关闭后销毁<br/>`undeinfed`-第一次打开时渲染,后跟随父组件销毁 |
211
+ | singleLayer | boolean | true | 是否只显示一层遮罩 |
212
+ | removeFocusOnOpen | boolean | true | 打开时是否移除当前焦点 |
213
+ | slideProps | [SlideProps](/components/transition) | | 传递给`<Slide/>`的属性 |
214
+ | maskProps | DOMAttributes | | 传递给遮罩层元素的属性 |
215
+
216
+ ---
217
+
218
+ ## useAppContext()
219
+
220
+ 如果你的应用使用了多个`<App/>`(入口组件),比如定义[局部样式](theme)。
221
+
222
+ 此时直接使用App全局方法,可能会导致上下文混淆,因此建议使用`useAppContext()`方法:
223
+
224
+ ```tsx no-preview
225
+ import {useAppContext} from '@canlooks/can-ui'
226
+
227
+ export default function Index() {
228
+ const {dialog, message, notification, actionSheet} = useAppContext()
229
+
230
+ const someMethod = () => {
231
+ dialog.confirm({
232
+ title: '对话框'
233
+ })
234
+ }
235
+
236
+ // ...
237
+ }
238
+ ```
@@ -0,0 +1,57 @@
1
+ # 图标
2
+
3
+ ## 图标库
4
+
5
+ CanUI并不内置图标,但对主流的图标库均做了样式适配,你可以使用任何你喜欢的图标库,比如
6
+ - [Font Awesome](https://fontawesome.com/)
7
+ - [Material Design Icons](https://materialdesignicons.com/)
8
+ - [Ant Design Icons](https://ant.design/components/icon/)
9
+ - [Heroicons](https://heroicons.com/)
10
+ - [Feather Icons](https://feathericons.com/)
11
+ - [Ionicons](https://ionicons.com/)
12
+
13
+ 等等。
14
+
15
+ CanUI默认使用`Font Awesome`并加入依赖项可直接使用。如果你想使用其他图标库,需要额外安装。
16
+
17
+ ## <Icon\/>
18
+
19
+ `<Icon/>`组件支持fontAwesome图标库,将fontAwesome导出的图标传入`icon`属性即可。
20
+
21
+ ```tsx
22
+ import {Icon} from '@canlooks/can-ui'
23
+ import {faUser} from '@fortawesome/free-solid-svg-icons'
24
+
25
+ export default function Index() {
26
+ return (
27
+ <Icon icon={faUser}/>
28
+ )
29
+ }
30
+ ```
31
+
32
+ ### Props
33
+
34
+ `<Icon/>`组件的属性继承于`FontAwesomeIconProps`,详情请查看[fontAwesome官方文档](https://fontawesome.com/)
35
+
36
+ ## 其他图标库
37
+
38
+ 使用其他图标库需要额外安装:
39
+
40
+ ### 以Material Design Icons为例
41
+
42
+ ```bash
43
+ npm i @mdi/react @mdi/js
44
+ ```
45
+
46
+ 然后像其官网介绍的那样使用即可:
47
+
48
+ ```tsx no-preview
49
+ import Icon from '@mdi/react'
50
+ import {mdiAccount} from '@mdi/js'
51
+
52
+ export default function Index() {
53
+ return (
54
+ <Icon path={mdiAccount} size={1}/>
55
+ )
56
+ }
57
+ ```
@@ -0,0 +1,2 @@
1
+ # 介绍
2
+
File without changes
@@ -0,0 +1,23 @@
1
+ # 开始
2
+ ## 安装
3
+
4
+ ```bash
5
+ npm i @canlooks/can-ui
6
+ ```
7
+ 或使用脚手架程序
8
+ ```bash
9
+ npx create-canlooks
10
+ ```
11
+
12
+ ## 使用
13
+ 你可以不进行任何配置就像使用其他`React`组件一样使用`CanUI`组件。
14
+
15
+ ```tsx
16
+ import {Alert} from '@canlooks/can-ui'
17
+
18
+ export default function Hello() {
19
+ return (
20
+ <Alert title="Hello Canlooks" status="success"/>
21
+ )
22
+ }
23
+ ```