vue-amazing-ui 2.0.0-beta.8 → 2.0.0
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/README.md +39 -12
- package/README.zh-CN.md +41 -14
- package/dist/index.iife.js +29 -29
- package/dist/index.js +1759 -1877
- package/dist/index.umd.cjs +33 -33
- package/dist/style.css +1 -1
- package/es/alert/index.d.ts +63 -2
- package/es/alert/index.js +4 -3
- package/es/avatar/Avatar.d.ts +1 -1
- package/es/avatar/index.d.ts +46 -2
- package/es/avatar/index.js +4 -3
- package/es/backtop/BackTop.vue2.js +7 -8
- package/es/backtop/index.d.ts +75 -2
- package/es/backtop/index.js +4 -3
- package/es/badge/Badge.css +1 -1
- package/es/badge/Badge.d.ts +2 -22
- package/es/badge/Badge.vue.js +2 -2
- package/es/badge/Badge.vue2.js +9 -11
- package/es/badge/index.d.ts +60 -3
- package/es/badge/index.js +4 -3
- package/es/breadcrumb/index.d.ts +44 -2
- package/es/breadcrumb/index.js +4 -3
- package/es/button/Button.d.ts +1 -1
- package/es/button/index.d.ts +74 -2
- package/es/button/index.js +3 -2
- package/es/card/Card.vue2.js +7 -8
- package/es/card/index.d.ts +53 -2
- package/es/card/index.js +4 -3
- package/es/carousel/Carousel.vue2.js +3 -4
- package/es/carousel/index.d.ts +116 -2
- package/es/carousel/index.js +4 -3
- package/es/cascader/Cascader.d.ts +1 -1
- package/es/cascader/Cascader.vue2.js +3 -4
- package/es/cascader/index.d.ts +77 -2
- package/es/cascader/index.js +4 -3
- package/es/checkbox/index.d.ts +65 -2
- package/es/checkbox/index.js +4 -3
- package/es/collapse/Collapse.vue2.js +6 -7
- package/es/collapse/index.d.ts +122 -2
- package/es/collapse/index.js +4 -3
- package/es/components.d.ts +3 -3
- package/es/components.js +119 -119
- package/es/countdown/index.d.ts +70 -2
- package/es/countdown/index.js +4 -3
- package/es/datepicker/index.d.ts +32 -2
- package/es/datepicker/index.js +4 -3
- package/es/descriptions/descriptions/index.d.ts +48 -2
- package/es/descriptions/descriptions/index.js +4 -3
- package/es/descriptions/descriptionsitem/index.d.ts +36 -2
- package/es/descriptions/descriptionsitem/index.js +4 -3
- package/es/dialog/Dialog.vue2.js +10 -11
- package/es/dialog/index.d.ts +115 -2
- package/es/dialog/index.js +4 -3
- package/es/divider/index.d.ts +42 -2
- package/es/divider/index.js +4 -3
- package/es/drawer/Drawer.vue2.js +3 -4
- package/es/drawer/index.d.ts +94 -2
- package/es/drawer/index.js +4 -3
- package/es/ellipsis/Ellipsis.d.ts +1 -120
- package/es/ellipsis/Ellipsis.vue2.js +10 -11
- package/es/ellipsis/index.d.ts +54 -2
- package/es/ellipsis/index.js +4 -3
- package/es/empty/index.d.ts +38 -2
- package/es/empty/index.js +3 -2
- package/es/flex/index.d.ts +39 -2
- package/es/flex/index.js +4 -3
- package/es/floatbutton/FloatButton.d.ts +1 -1
- package/es/floatbutton/FloatButton.vue2.js +7 -9
- package/es/floatbutton/index.d.ts +90 -2
- package/es/floatbutton/index.js +3 -2
- package/es/gradienttext/index.d.ts +33 -2
- package/es/gradienttext/index.js +4 -3
- package/es/grid/col/index.d.ts +105 -2
- package/es/grid/col/index.js +4 -3
- package/es/grid/row/index.d.ts +36 -2
- package/es/grid/row/index.js +4 -3
- package/es/image/Image.vue2.js +4 -6
- package/es/image/index.d.ts +72 -2
- package/es/image/index.js +4 -3
- package/es/index.d.ts +1 -0
- package/es/index.js +159 -216
- package/es/input/index.d.ts +86 -2
- package/es/input/index.js +3 -2
- package/es/inputnumber/index.d.ts +75 -2
- package/es/inputnumber/index.js +4 -3
- package/es/inputsearch/InputSearch.vue2.js +6 -7
- package/es/inputsearch/index.d.ts +92 -2
- package/es/inputsearch/index.js +4 -3
- package/es/list/list/List.vue2.js +9 -12
- package/es/list/list/index.d.ts +59 -2
- package/es/list/list/index.js +3 -2
- package/es/list/listitem/ListItem.vue2.js +7 -8
- package/es/list/listitem/index.d.ts +62 -2
- package/es/list/listitem/index.js +3 -2
- package/es/loadingbar/index.d.ts +50 -2
- package/es/loadingbar/index.js +4 -3
- package/es/message/index.d.ts +62 -2
- package/es/message/index.js +4 -3
- package/es/modal/Modal.vue2.js +3 -4
- package/es/modal/index.d.ts +138 -2
- package/es/modal/index.js +4 -3
- package/es/notification/index.d.ts +63 -2
- package/es/notification/index.js +4 -3
- package/es/numberanimation/NumberAnimation.d.ts +1 -26
- package/es/numberanimation/index.d.ts +72 -3
- package/es/numberanimation/index.js +4 -3
- package/es/pagination/Pagination.vue2.js +7 -9
- package/es/pagination/index.d.ts +78 -2
- package/es/pagination/index.js +4 -3
- package/es/popconfirm/Popconfirm.d.ts +1 -120
- package/es/popconfirm/Popconfirm.vue2.js +7 -9
- package/es/popconfirm/index.d.ts +86 -2
- package/es/popconfirm/index.js +4 -3
- package/es/popover/Popover.vue2.js +6 -7
- package/es/popover/index.d.ts +41 -2
- package/es/popover/index.js +4 -3
- package/es/progress/index.d.ts +58 -2
- package/es/progress/index.js +4 -3
- package/es/qrcode/index.d.ts +41 -2
- package/es/qrcode/index.js +4 -3
- package/es/radio/index.d.ts +75 -2
- package/es/radio/index.js +4 -3
- package/es/rate/Rate.vue2.js +5 -6
- package/es/rate/index.d.ts +78 -2
- package/es/rate/index.js +4 -3
- package/es/result/index.d.ts +40 -2
- package/es/result/index.js +4 -3
- package/es/scrollbar/index.d.ts +93 -2
- package/es/scrollbar/index.js +4 -3
- package/es/segmented/index.d.ts +54 -2
- package/es/segmented/index.js +4 -3
- package/es/select/Select.vue2.js +6 -8
- package/es/select/index.d.ts +79 -2
- package/es/select/index.js +4 -3
- package/es/skeleton/index.d.ts +45 -2
- package/es/skeleton/index.js +4 -3
- package/es/slider/index.d.ts +65 -2
- package/es/slider/index.js +4 -3
- package/es/space/index.d.ts +36 -2
- package/es/space/index.js +4 -3
- package/es/spin/index.d.ts +55 -2
- package/es/spin/index.js +4 -3
- package/es/statistic/index.d.ts +48 -2
- package/es/statistic/index.js +3 -2
- package/es/steps/index.d.ts +53 -2
- package/es/steps/index.js +4 -3
- package/es/swiper/index.d.ts +68 -2
- package/es/swiper/index.js +4 -3
- package/es/switch/index.d.ts +70 -2
- package/es/switch/index.js +3 -2
- package/es/table/Table.css +1 -1
- package/es/table/Table.d.ts +6 -302
- package/es/table/Table.vue.js +1 -1
- package/es/table/Table.vue2.js +22 -28
- package/es/table/index.d.ts +308 -3
- package/es/table/index.js +4 -3
- package/es/tabs/index.d.ts +81 -2
- package/es/tabs/index.js +3 -2
- package/es/tag/Tag.vue2.js +13 -14
- package/es/tag/index.d.ts +73 -2
- package/es/tag/index.js +4 -3
- package/es/textarea/index.d.ts +73 -2
- package/es/textarea/index.js +4 -3
- package/es/textscroll/index.d.ts +78 -2
- package/es/textscroll/index.js +4 -3
- package/es/timeline/index.d.ts +41 -2
- package/es/timeline/index.js +4 -3
- package/es/timepicker/index.d.ts +1 -3
- package/es/tooltip/index.d.ts +103 -2
- package/es/tooltip/index.js +4 -3
- package/es/upload/Upload.d.ts +2 -134
- package/es/upload/Upload.vue2.js +17 -21
- package/es/upload/index.d.ts +117 -2
- package/es/upload/index.js +4 -3
- package/es/utils/resolver.d.ts +8 -0
- package/es/utils/resolver.js +9 -0
- package/es/utils/type.js +9 -0
- package/es/video/Video.css +1 -1
- package/es/video/Video.vue.js +1 -1
- package/es/video/Video.vue2.js +13 -11
- package/es/video/index.d.ts +80 -2
- package/es/video/index.js +4 -3
- package/es/waterfall/Waterfall.vue2.js +6 -7
- package/es/waterfall/index.d.ts +38 -2
- package/es/waterfall/index.js +4 -3
- package/es/watermark/index.d.ts +54 -2
- package/es/watermark/index.js +4 -3
- package/lib/alert/index.cjs +1 -1
- package/lib/alert/index.d.ts +63 -2
- package/lib/avatar/Avatar.d.ts +1 -1
- package/lib/avatar/index.cjs +1 -1
- package/lib/avatar/index.d.ts +46 -2
- package/lib/backtop/BackTop.vue2.cjs +1 -1
- package/lib/backtop/index.cjs +1 -1
- package/lib/backtop/index.d.ts +75 -2
- package/lib/badge/Badge.css +1 -1
- package/lib/badge/Badge.d.ts +2 -22
- package/lib/badge/Badge.vue.cjs +1 -1
- package/lib/badge/Badge.vue2.cjs +1 -1
- package/lib/badge/index.cjs +1 -1
- package/lib/badge/index.d.ts +60 -3
- package/lib/breadcrumb/index.cjs +1 -1
- package/lib/breadcrumb/index.d.ts +44 -2
- package/lib/button/Button.d.ts +1 -1
- package/lib/button/index.cjs +1 -1
- package/lib/button/index.d.ts +74 -2
- package/lib/card/Card.vue2.cjs +1 -1
- package/lib/card/index.cjs +1 -1
- package/lib/card/index.d.ts +53 -2
- package/lib/carousel/Carousel.vue2.cjs +1 -1
- package/lib/carousel/index.cjs +1 -1
- package/lib/carousel/index.d.ts +116 -2
- package/lib/cascader/Cascader.d.ts +1 -1
- package/lib/cascader/Cascader.vue2.cjs +1 -1
- package/lib/cascader/index.cjs +1 -1
- package/lib/cascader/index.d.ts +77 -2
- package/lib/checkbox/index.cjs +1 -1
- package/lib/checkbox/index.d.ts +65 -2
- package/lib/collapse/Collapse.vue2.cjs +1 -1
- package/lib/collapse/index.cjs +1 -1
- package/lib/collapse/index.d.ts +122 -2
- package/lib/components.cjs +1 -1
- package/lib/components.d.ts +3 -3
- package/lib/countdown/index.cjs +1 -1
- package/lib/countdown/index.d.ts +70 -2
- package/lib/datepicker/index.cjs +1 -1
- package/lib/datepicker/index.d.ts +32 -2
- package/lib/descriptions/descriptions/index.cjs +1 -1
- package/lib/descriptions/descriptions/index.d.ts +48 -2
- package/lib/descriptions/descriptionsitem/index.cjs +1 -1
- package/lib/descriptions/descriptionsitem/index.d.ts +36 -2
- package/lib/dialog/Dialog.vue2.cjs +1 -1
- package/lib/dialog/index.cjs +1 -1
- package/lib/dialog/index.d.ts +115 -2
- package/lib/divider/index.cjs +1 -1
- package/lib/divider/index.d.ts +42 -2
- package/lib/drawer/Drawer.vue2.cjs +1 -1
- package/lib/drawer/index.cjs +1 -1
- package/lib/drawer/index.d.ts +94 -2
- package/lib/ellipsis/Ellipsis.d.ts +1 -120
- package/lib/ellipsis/Ellipsis.vue2.cjs +1 -1
- package/lib/ellipsis/index.cjs +1 -1
- package/lib/ellipsis/index.d.ts +54 -2
- package/lib/empty/index.cjs +1 -1
- package/lib/empty/index.d.ts +38 -2
- package/lib/flex/index.cjs +1 -1
- package/lib/flex/index.d.ts +39 -2
- package/lib/floatbutton/FloatButton.d.ts +1 -1
- package/lib/floatbutton/FloatButton.vue2.cjs +2 -2
- package/lib/floatbutton/index.cjs +1 -1
- package/lib/floatbutton/index.d.ts +90 -2
- package/lib/gradienttext/index.cjs +1 -1
- package/lib/gradienttext/index.d.ts +33 -2
- package/lib/grid/col/index.cjs +1 -1
- package/lib/grid/col/index.d.ts +105 -2
- package/lib/grid/row/index.cjs +1 -1
- package/lib/grid/row/index.d.ts +36 -2
- package/lib/image/Image.vue2.cjs +1 -1
- package/lib/image/index.cjs +1 -1
- package/lib/image/index.d.ts +72 -2
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/input/index.cjs +1 -1
- package/lib/input/index.d.ts +86 -2
- package/lib/inputnumber/index.cjs +1 -1
- package/lib/inputnumber/index.d.ts +75 -2
- package/lib/inputsearch/InputSearch.vue2.cjs +1 -1
- package/lib/inputsearch/index.cjs +1 -1
- package/lib/inputsearch/index.d.ts +92 -2
- package/lib/list/list/List.vue2.cjs +1 -1
- package/lib/list/list/index.cjs +1 -1
- package/lib/list/list/index.d.ts +59 -2
- package/lib/list/listitem/ListItem.vue2.cjs +1 -1
- package/lib/list/listitem/index.cjs +1 -1
- package/lib/list/listitem/index.d.ts +62 -2
- package/lib/loadingbar/index.cjs +1 -1
- package/lib/loadingbar/index.d.ts +50 -2
- package/lib/message/index.cjs +1 -1
- package/lib/message/index.d.ts +62 -2
- package/lib/modal/Modal.vue2.cjs +1 -1
- package/lib/modal/index.cjs +1 -1
- package/lib/modal/index.d.ts +138 -2
- package/lib/notification/index.cjs +1 -1
- package/lib/notification/index.d.ts +63 -2
- package/lib/numberanimation/NumberAnimation.d.ts +1 -26
- package/lib/numberanimation/index.cjs +1 -1
- package/lib/numberanimation/index.d.ts +72 -3
- package/lib/pagination/Pagination.vue2.cjs +1 -1
- package/lib/pagination/index.cjs +1 -1
- package/lib/pagination/index.d.ts +78 -2
- package/lib/popconfirm/Popconfirm.d.ts +1 -120
- package/lib/popconfirm/Popconfirm.vue2.cjs +1 -1
- package/lib/popconfirm/index.cjs +1 -1
- package/lib/popconfirm/index.d.ts +86 -2
- package/lib/popover/Popover.vue2.cjs +1 -1
- package/lib/popover/index.cjs +1 -1
- package/lib/popover/index.d.ts +41 -2
- package/lib/progress/index.cjs +1 -1
- package/lib/progress/index.d.ts +58 -2
- package/lib/qrcode/index.cjs +1 -1
- package/lib/qrcode/index.d.ts +41 -2
- package/lib/radio/index.cjs +1 -1
- package/lib/radio/index.d.ts +75 -2
- package/lib/rate/Rate.vue2.cjs +1 -1
- package/lib/rate/index.cjs +1 -1
- package/lib/rate/index.d.ts +78 -2
- package/lib/result/index.cjs +1 -1
- package/lib/result/index.d.ts +40 -2
- package/lib/scrollbar/index.cjs +1 -1
- package/lib/scrollbar/index.d.ts +93 -2
- package/lib/segmented/index.cjs +1 -1
- package/lib/segmented/index.d.ts +54 -2
- package/lib/select/Select.vue2.cjs +1 -1
- package/lib/select/index.cjs +1 -1
- package/lib/select/index.d.ts +79 -2
- package/lib/skeleton/index.cjs +1 -1
- package/lib/skeleton/index.d.ts +45 -2
- package/lib/slider/index.cjs +1 -1
- package/lib/slider/index.d.ts +65 -2
- package/lib/space/index.cjs +1 -1
- package/lib/space/index.d.ts +36 -2
- package/lib/spin/index.cjs +1 -1
- package/lib/spin/index.d.ts +55 -2
- package/lib/statistic/index.cjs +1 -1
- package/lib/statistic/index.d.ts +48 -2
- package/lib/steps/index.cjs +1 -1
- package/lib/steps/index.d.ts +53 -2
- package/lib/swiper/index.cjs +1 -1
- package/lib/swiper/index.d.ts +68 -2
- package/lib/switch/index.cjs +1 -1
- package/lib/switch/index.d.ts +70 -2
- package/lib/table/Table.css +1 -1
- package/lib/table/Table.d.ts +6 -302
- package/lib/table/Table.vue.cjs +1 -1
- package/lib/table/Table.vue2.cjs +1 -1
- package/lib/table/index.cjs +1 -1
- package/lib/table/index.d.ts +308 -3
- package/lib/tabs/index.cjs +1 -1
- package/lib/tabs/index.d.ts +81 -2
- package/lib/tag/Tag.vue2.cjs +1 -1
- package/lib/tag/index.cjs +1 -1
- package/lib/tag/index.d.ts +73 -2
- package/lib/textarea/index.cjs +1 -1
- package/lib/textarea/index.d.ts +73 -2
- package/lib/textscroll/index.cjs +1 -1
- package/lib/textscroll/index.d.ts +78 -2
- package/lib/timeline/index.cjs +1 -1
- package/lib/timeline/index.d.ts +41 -2
- package/lib/timepicker/index.d.ts +1 -3
- package/lib/tooltip/index.cjs +1 -1
- package/lib/tooltip/index.d.ts +103 -2
- package/lib/upload/Upload.d.ts +2 -134
- package/lib/upload/Upload.vue2.cjs +1 -1
- package/lib/upload/index.cjs +1 -1
- package/lib/upload/index.d.ts +117 -2
- package/lib/utils/resolver.cjs +1 -0
- package/lib/utils/resolver.d.ts +8 -0
- package/lib/utils/type.cjs +1 -0
- package/lib/video/Video.css +1 -1
- package/lib/video/Video.vue.cjs +1 -1
- package/lib/video/Video.vue2.cjs +1 -1
- package/lib/video/index.cjs +1 -1
- package/lib/video/index.d.ts +80 -2
- package/lib/waterfall/Waterfall.vue2.cjs +1 -1
- package/lib/waterfall/index.cjs +1 -1
- package/lib/waterfall/index.d.ts +38 -2
- package/lib/watermark/index.cjs +1 -1
- package/lib/watermark/index.d.ts +54 -2
- package/package.json +14 -3
- package/es/timepicker/TimePicker.d.ts +0 -44
- package/lib/timepicker/TimePicker.d.ts +0 -44
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<h1 align="center">Vue Amazing UI</h1>
|
|
8
8
|
<p align="center">A Vue 3 Component Library</p>
|
|
9
|
-
<p align="center">Each component is a Single-File Component (SFC), which can be used Independently</p>
|
|
9
|
+
<p align="center">Uses TypeScript, Each component is a Single-File Component (SFC), which can be used Independently</p>
|
|
10
10
|
<p align="center">Kinda Interesting</p>
|
|
11
11
|
<p align="center">English | <a href="README.zh-CN.md">中文</a></p>
|
|
12
12
|
|
|
@@ -18,17 +18,18 @@
|
|
|
18
18
|
|
|
19
19
|
- The component library is implemented with `Vue@3.5.13`+ `TypeScript@5.6.3` + `Vite@6.0.2` + `Less@4.2.1`.
|
|
20
20
|
- Currently, it includes `63` basic UI components and `16` utility functions, with continuous exploration and updates ongoing...
|
|
21
|
+
- What's more, they are all treeshakable.
|
|
21
22
|
- All the stuff in Vue Amazing UI is written in TypeScript. It can work with your typescript project seamlessly.
|
|
22
23
|
- Each component is a Single-File Component (`SFC`), and they can be used independently without any issues.
|
|
23
24
|
- Ready to use out of the box, no fuss.
|
|
24
25
|
|
|
25
26
|
## Installation
|
|
26
27
|
|
|
27
|
-
```
|
|
28
|
-
npm install vue-amazing-ui
|
|
29
|
-
# or
|
|
28
|
+
```sh
|
|
30
29
|
pnpm add vue-amazing-ui
|
|
31
30
|
# or
|
|
31
|
+
npm install vue-amazing-ui
|
|
32
|
+
# or
|
|
32
33
|
yarn add vue-amazing-ui
|
|
33
34
|
# or
|
|
34
35
|
bun add vue-amazing-ui
|
|
@@ -36,36 +37,45 @@ bun add vue-amazing-ui
|
|
|
36
37
|
|
|
37
38
|
## Use Components
|
|
38
39
|
|
|
39
|
-
**Global Registration All Components**
|
|
40
|
+
**Global Registration All Components (Not Recommended)**
|
|
41
|
+
|
|
42
|
+
*No tree-shaking. Bundle will have redundant codes.*
|
|
40
43
|
|
|
41
44
|
```ts
|
|
42
45
|
import { createApp } from 'vue'
|
|
43
46
|
import App from './App.vue'
|
|
44
47
|
import VueAmazingUI from 'vue-amazing-ui'
|
|
45
|
-
import 'vue-amazing-ui/css'
|
|
48
|
+
import 'vue-amazing-ui/css' // 等价于 'vue-amazing-ui/dist/style.css'
|
|
46
49
|
|
|
47
50
|
const app = createApp(App)
|
|
48
|
-
app.use(VueAmazingUI)
|
|
51
|
+
app.use(VueAmazingUI)
|
|
52
|
+
app.mount('#app')
|
|
49
53
|
```
|
|
50
54
|
|
|
51
55
|
**Global Registration Some Components**
|
|
52
56
|
|
|
57
|
+
*Both global and local importing of components result in only the imported components being packaged.*
|
|
58
|
+
|
|
53
59
|
```ts
|
|
54
60
|
import { createApp } from 'vue'
|
|
55
61
|
import App from './App.vue'
|
|
56
62
|
import { Button, Tag } from 'vue-amazing-ui'
|
|
57
|
-
import 'vue-amazing-ui/css'
|
|
63
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
64
|
+
import 'vue-amazing-ui/es/tag/Tag.css'
|
|
58
65
|
|
|
59
66
|
const app = createApp(App)
|
|
60
|
-
app.use(Button).use(Tag)
|
|
67
|
+
app.use(Button).use(Tag)
|
|
68
|
+
app.mount('#app')
|
|
61
69
|
```
|
|
62
70
|
|
|
63
|
-
**Local Registration**
|
|
71
|
+
**Local Registration (Recommended)**
|
|
72
|
+
|
|
73
|
+
*In this form, only components imported will be bundled.*
|
|
64
74
|
|
|
65
75
|
```vue
|
|
66
76
|
<script setup lang="ts">
|
|
67
77
|
import { Button } from 'vue-amazing-ui'
|
|
68
|
-
import 'vue-amazing-ui/css'
|
|
78
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
69
79
|
</script>
|
|
70
80
|
<template>
|
|
71
81
|
<Button>button</Button>
|
|
@@ -97,6 +107,23 @@ import {
|
|
|
97
107
|
</script>
|
|
98
108
|
```
|
|
99
109
|
|
|
110
|
+
## Use Types
|
|
111
|
+
|
|
112
|
+
*All types can be directly imported from vue-amazing-ui without the need for additional installation.*
|
|
113
|
+
|
|
114
|
+
```vue
|
|
115
|
+
<script setup lang="ts">
|
|
116
|
+
import { Button } from 'vue-amazing-ui'
|
|
117
|
+
import type { ButtonProps } from 'vue-amazing-ui'
|
|
118
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
119
|
+
|
|
120
|
+
const shape = ref<ButtonProps['shape']>('default')
|
|
121
|
+
</script>
|
|
122
|
+
<template>
|
|
123
|
+
<Button :shape="shape">button</Button>
|
|
124
|
+
</template>
|
|
125
|
+
```
|
|
126
|
+
|
|
100
127
|
## Project
|
|
101
128
|
|
|
102
129
|
- Get the project code
|
|
@@ -119,7 +146,7 @@ pnpm i
|
|
|
119
146
|
pnpm dev
|
|
120
147
|
```
|
|
121
148
|
|
|
122
|
-
##
|
|
149
|
+
## Blogs
|
|
123
150
|
|
|
124
151
|
[My CSDN Blogs](https://blog.csdn.net/Dandrose)
|
|
125
152
|
|
package/README.zh-CN.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<h1 align="center">Vue Amazing UI</h1>
|
|
8
8
|
<p align="center">一个 Vue 3 组件库</p>
|
|
9
|
-
<p align="center"
|
|
9
|
+
<p align="center">使用 TypeScript,每个组件都是单文件组件 (SFC), 可独立使用</p>
|
|
10
10
|
<p align="center">有点意思</p>
|
|
11
11
|
<p align="center"><a href="README.md">English</a> | 中文</p>
|
|
12
12
|
|
|
@@ -18,17 +18,18 @@
|
|
|
18
18
|
|
|
19
19
|
- 组件库采用 `Vue@3.5.13`+ `TypeScript@5.6.3` + `Vite@6.0.2` + `Less@4.2.1` 实现
|
|
20
20
|
- 目前共包含 `63` 个基础 `UI` 组件以及 `16` 个工具函数,并且持续探索更新中...
|
|
21
|
+
- 顺便一提,它们全都可以 `treeshaking`
|
|
21
22
|
- `Vue Amazing UI` 全量使用 `TypeScript` 编写,和你的 `TypeScript` 项目无缝衔接
|
|
22
|
-
- 每个组件都是单文件组件 `SFC
|
|
23
|
+
- 每个组件都是单文件组件 `SFC`,独立使用,也没问题
|
|
23
24
|
- 开箱即用,不墨迹
|
|
24
25
|
|
|
25
26
|
## 安装
|
|
26
27
|
|
|
27
|
-
```
|
|
28
|
-
npm install vue-amazing-ui
|
|
29
|
-
# or
|
|
28
|
+
```sh
|
|
30
29
|
pnpm add vue-amazing-ui
|
|
31
30
|
# or
|
|
31
|
+
npm install vue-amazing-ui
|
|
32
|
+
# or
|
|
32
33
|
yarn add vue-amazing-ui
|
|
33
34
|
# or
|
|
34
35
|
bun add vue-amazing-ui
|
|
@@ -36,36 +37,45 @@ bun add vue-amazing-ui
|
|
|
36
37
|
|
|
37
38
|
## 使用组件
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
**全局完整注册(不推荐)**
|
|
41
|
+
|
|
42
|
+
*失去 `tree-shaking` 的能力,打包后有冗余代码*
|
|
40
43
|
|
|
41
44
|
```ts
|
|
42
45
|
import { createApp } from 'vue'
|
|
43
46
|
import App from './App.vue'
|
|
44
47
|
import VueAmazingUI from 'vue-amazing-ui'
|
|
45
|
-
import 'vue-amazing-ui/css'
|
|
48
|
+
import 'vue-amazing-ui/css' // 等价于 'vue-amazing-ui/dist/style.css'
|
|
46
49
|
|
|
47
50
|
const app = createApp(App)
|
|
48
|
-
app.use(VueAmazingUI)
|
|
51
|
+
app.use(VueAmazingUI)
|
|
52
|
+
app.mount('#app')
|
|
49
53
|
```
|
|
50
54
|
|
|
51
|
-
|
|
55
|
+
**全局部分注册**
|
|
56
|
+
|
|
57
|
+
*全局或局部引入部分组件,都只有导入的组件才会被打包*
|
|
52
58
|
|
|
53
59
|
```ts
|
|
54
60
|
import { createApp } from 'vue'
|
|
55
61
|
import App from './App.vue'
|
|
56
62
|
import { Button, Tag } from 'vue-amazing-ui'
|
|
57
|
-
import 'vue-amazing-ui/css'
|
|
63
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
64
|
+
import 'vue-amazing-ui/es/tag/Tag.css'
|
|
58
65
|
|
|
59
66
|
const app = createApp(App)
|
|
60
|
-
app.use(Button).use(Tag)
|
|
67
|
+
app.use(Button).use(Tag)
|
|
68
|
+
app.mount('#app')
|
|
61
69
|
```
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
**局部注册组件(推荐)**
|
|
72
|
+
|
|
73
|
+
*这种情况下,也只有导入的组件才会被打包*
|
|
64
74
|
|
|
65
75
|
```vue
|
|
66
76
|
<script setup lang="ts">
|
|
67
77
|
import { Button } from 'vue-amazing-ui'
|
|
68
|
-
import 'vue-amazing-ui/css'
|
|
78
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
69
79
|
</script>
|
|
70
80
|
<template>
|
|
71
81
|
<Button>button</Button>
|
|
@@ -97,6 +107,23 @@ import {
|
|
|
97
107
|
</script>
|
|
98
108
|
```
|
|
99
109
|
|
|
110
|
+
## 使用类型
|
|
111
|
+
|
|
112
|
+
*所有类型均可直接从 `vue-amazing-ui` 中引入使用,无需额外安装*
|
|
113
|
+
|
|
114
|
+
```vue
|
|
115
|
+
<script setup lang="ts">
|
|
116
|
+
import { Button } from 'vue-amazing-ui'
|
|
117
|
+
import type { ButtonProps } from 'vue-amazing-ui'
|
|
118
|
+
import 'vue-amazing-ui/es/button/Button.css'
|
|
119
|
+
|
|
120
|
+
const shape = ref<ButtonProps['shape']>('default')
|
|
121
|
+
</script>
|
|
122
|
+
<template>
|
|
123
|
+
<Button :shape="shape">button</Button>
|
|
124
|
+
</template>
|
|
125
|
+
```
|
|
126
|
+
|
|
100
127
|
## 项目
|
|
101
128
|
|
|
102
129
|
- 获取项目代码
|
|
@@ -119,7 +146,7 @@ pnpm i
|
|
|
119
146
|
pnpm dev
|
|
120
147
|
```
|
|
121
148
|
|
|
122
|
-
##
|
|
149
|
+
## 博客
|
|
123
150
|
|
|
124
151
|
[My CSDN Blogs](https://blog.csdn.net/Dandrose)
|
|
125
152
|
|