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.
Files changed (371) hide show
  1. package/README.md +39 -12
  2. package/README.zh-CN.md +41 -14
  3. package/dist/index.iife.js +29 -29
  4. package/dist/index.js +1759 -1877
  5. package/dist/index.umd.cjs +33 -33
  6. package/dist/style.css +1 -1
  7. package/es/alert/index.d.ts +63 -2
  8. package/es/alert/index.js +4 -3
  9. package/es/avatar/Avatar.d.ts +1 -1
  10. package/es/avatar/index.d.ts +46 -2
  11. package/es/avatar/index.js +4 -3
  12. package/es/backtop/BackTop.vue2.js +7 -8
  13. package/es/backtop/index.d.ts +75 -2
  14. package/es/backtop/index.js +4 -3
  15. package/es/badge/Badge.css +1 -1
  16. package/es/badge/Badge.d.ts +2 -22
  17. package/es/badge/Badge.vue.js +2 -2
  18. package/es/badge/Badge.vue2.js +9 -11
  19. package/es/badge/index.d.ts +60 -3
  20. package/es/badge/index.js +4 -3
  21. package/es/breadcrumb/index.d.ts +44 -2
  22. package/es/breadcrumb/index.js +4 -3
  23. package/es/button/Button.d.ts +1 -1
  24. package/es/button/index.d.ts +74 -2
  25. package/es/button/index.js +3 -2
  26. package/es/card/Card.vue2.js +7 -8
  27. package/es/card/index.d.ts +53 -2
  28. package/es/card/index.js +4 -3
  29. package/es/carousel/Carousel.vue2.js +3 -4
  30. package/es/carousel/index.d.ts +116 -2
  31. package/es/carousel/index.js +4 -3
  32. package/es/cascader/Cascader.d.ts +1 -1
  33. package/es/cascader/Cascader.vue2.js +3 -4
  34. package/es/cascader/index.d.ts +77 -2
  35. package/es/cascader/index.js +4 -3
  36. package/es/checkbox/index.d.ts +65 -2
  37. package/es/checkbox/index.js +4 -3
  38. package/es/collapse/Collapse.vue2.js +6 -7
  39. package/es/collapse/index.d.ts +122 -2
  40. package/es/collapse/index.js +4 -3
  41. package/es/components.d.ts +3 -3
  42. package/es/components.js +119 -119
  43. package/es/countdown/index.d.ts +70 -2
  44. package/es/countdown/index.js +4 -3
  45. package/es/datepicker/index.d.ts +32 -2
  46. package/es/datepicker/index.js +4 -3
  47. package/es/descriptions/descriptions/index.d.ts +48 -2
  48. package/es/descriptions/descriptions/index.js +4 -3
  49. package/es/descriptions/descriptionsitem/index.d.ts +36 -2
  50. package/es/descriptions/descriptionsitem/index.js +4 -3
  51. package/es/dialog/Dialog.vue2.js +10 -11
  52. package/es/dialog/index.d.ts +115 -2
  53. package/es/dialog/index.js +4 -3
  54. package/es/divider/index.d.ts +42 -2
  55. package/es/divider/index.js +4 -3
  56. package/es/drawer/Drawer.vue2.js +3 -4
  57. package/es/drawer/index.d.ts +94 -2
  58. package/es/drawer/index.js +4 -3
  59. package/es/ellipsis/Ellipsis.d.ts +1 -120
  60. package/es/ellipsis/Ellipsis.vue2.js +10 -11
  61. package/es/ellipsis/index.d.ts +54 -2
  62. package/es/ellipsis/index.js +4 -3
  63. package/es/empty/index.d.ts +38 -2
  64. package/es/empty/index.js +3 -2
  65. package/es/flex/index.d.ts +39 -2
  66. package/es/flex/index.js +4 -3
  67. package/es/floatbutton/FloatButton.d.ts +1 -1
  68. package/es/floatbutton/FloatButton.vue2.js +7 -9
  69. package/es/floatbutton/index.d.ts +90 -2
  70. package/es/floatbutton/index.js +3 -2
  71. package/es/gradienttext/index.d.ts +33 -2
  72. package/es/gradienttext/index.js +4 -3
  73. package/es/grid/col/index.d.ts +105 -2
  74. package/es/grid/col/index.js +4 -3
  75. package/es/grid/row/index.d.ts +36 -2
  76. package/es/grid/row/index.js +4 -3
  77. package/es/image/Image.vue2.js +4 -6
  78. package/es/image/index.d.ts +72 -2
  79. package/es/image/index.js +4 -3
  80. package/es/index.d.ts +1 -0
  81. package/es/index.js +159 -216
  82. package/es/input/index.d.ts +86 -2
  83. package/es/input/index.js +3 -2
  84. package/es/inputnumber/index.d.ts +75 -2
  85. package/es/inputnumber/index.js +4 -3
  86. package/es/inputsearch/InputSearch.vue2.js +6 -7
  87. package/es/inputsearch/index.d.ts +92 -2
  88. package/es/inputsearch/index.js +4 -3
  89. package/es/list/list/List.vue2.js +9 -12
  90. package/es/list/list/index.d.ts +59 -2
  91. package/es/list/list/index.js +3 -2
  92. package/es/list/listitem/ListItem.vue2.js +7 -8
  93. package/es/list/listitem/index.d.ts +62 -2
  94. package/es/list/listitem/index.js +3 -2
  95. package/es/loadingbar/index.d.ts +50 -2
  96. package/es/loadingbar/index.js +4 -3
  97. package/es/message/index.d.ts +62 -2
  98. package/es/message/index.js +4 -3
  99. package/es/modal/Modal.vue2.js +3 -4
  100. package/es/modal/index.d.ts +138 -2
  101. package/es/modal/index.js +4 -3
  102. package/es/notification/index.d.ts +63 -2
  103. package/es/notification/index.js +4 -3
  104. package/es/numberanimation/NumberAnimation.d.ts +1 -26
  105. package/es/numberanimation/index.d.ts +72 -3
  106. package/es/numberanimation/index.js +4 -3
  107. package/es/pagination/Pagination.vue2.js +7 -9
  108. package/es/pagination/index.d.ts +78 -2
  109. package/es/pagination/index.js +4 -3
  110. package/es/popconfirm/Popconfirm.d.ts +1 -120
  111. package/es/popconfirm/Popconfirm.vue2.js +7 -9
  112. package/es/popconfirm/index.d.ts +86 -2
  113. package/es/popconfirm/index.js +4 -3
  114. package/es/popover/Popover.vue2.js +6 -7
  115. package/es/popover/index.d.ts +41 -2
  116. package/es/popover/index.js +4 -3
  117. package/es/progress/index.d.ts +58 -2
  118. package/es/progress/index.js +4 -3
  119. package/es/qrcode/index.d.ts +41 -2
  120. package/es/qrcode/index.js +4 -3
  121. package/es/radio/index.d.ts +75 -2
  122. package/es/radio/index.js +4 -3
  123. package/es/rate/Rate.vue2.js +5 -6
  124. package/es/rate/index.d.ts +78 -2
  125. package/es/rate/index.js +4 -3
  126. package/es/result/index.d.ts +40 -2
  127. package/es/result/index.js +4 -3
  128. package/es/scrollbar/index.d.ts +93 -2
  129. package/es/scrollbar/index.js +4 -3
  130. package/es/segmented/index.d.ts +54 -2
  131. package/es/segmented/index.js +4 -3
  132. package/es/select/Select.vue2.js +6 -8
  133. package/es/select/index.d.ts +79 -2
  134. package/es/select/index.js +4 -3
  135. package/es/skeleton/index.d.ts +45 -2
  136. package/es/skeleton/index.js +4 -3
  137. package/es/slider/index.d.ts +65 -2
  138. package/es/slider/index.js +4 -3
  139. package/es/space/index.d.ts +36 -2
  140. package/es/space/index.js +4 -3
  141. package/es/spin/index.d.ts +55 -2
  142. package/es/spin/index.js +4 -3
  143. package/es/statistic/index.d.ts +48 -2
  144. package/es/statistic/index.js +3 -2
  145. package/es/steps/index.d.ts +53 -2
  146. package/es/steps/index.js +4 -3
  147. package/es/swiper/index.d.ts +68 -2
  148. package/es/swiper/index.js +4 -3
  149. package/es/switch/index.d.ts +70 -2
  150. package/es/switch/index.js +3 -2
  151. package/es/table/Table.css +1 -1
  152. package/es/table/Table.d.ts +6 -302
  153. package/es/table/Table.vue.js +1 -1
  154. package/es/table/Table.vue2.js +22 -28
  155. package/es/table/index.d.ts +308 -3
  156. package/es/table/index.js +4 -3
  157. package/es/tabs/index.d.ts +81 -2
  158. package/es/tabs/index.js +3 -2
  159. package/es/tag/Tag.vue2.js +13 -14
  160. package/es/tag/index.d.ts +73 -2
  161. package/es/tag/index.js +4 -3
  162. package/es/textarea/index.d.ts +73 -2
  163. package/es/textarea/index.js +4 -3
  164. package/es/textscroll/index.d.ts +78 -2
  165. package/es/textscroll/index.js +4 -3
  166. package/es/timeline/index.d.ts +41 -2
  167. package/es/timeline/index.js +4 -3
  168. package/es/timepicker/index.d.ts +1 -3
  169. package/es/tooltip/index.d.ts +103 -2
  170. package/es/tooltip/index.js +4 -3
  171. package/es/upload/Upload.d.ts +2 -134
  172. package/es/upload/Upload.vue2.js +17 -21
  173. package/es/upload/index.d.ts +117 -2
  174. package/es/upload/index.js +4 -3
  175. package/es/utils/resolver.d.ts +8 -0
  176. package/es/utils/resolver.js +9 -0
  177. package/es/utils/type.js +9 -0
  178. package/es/video/Video.css +1 -1
  179. package/es/video/Video.vue.js +1 -1
  180. package/es/video/Video.vue2.js +13 -11
  181. package/es/video/index.d.ts +80 -2
  182. package/es/video/index.js +4 -3
  183. package/es/waterfall/Waterfall.vue2.js +6 -7
  184. package/es/waterfall/index.d.ts +38 -2
  185. package/es/waterfall/index.js +4 -3
  186. package/es/watermark/index.d.ts +54 -2
  187. package/es/watermark/index.js +4 -3
  188. package/lib/alert/index.cjs +1 -1
  189. package/lib/alert/index.d.ts +63 -2
  190. package/lib/avatar/Avatar.d.ts +1 -1
  191. package/lib/avatar/index.cjs +1 -1
  192. package/lib/avatar/index.d.ts +46 -2
  193. package/lib/backtop/BackTop.vue2.cjs +1 -1
  194. package/lib/backtop/index.cjs +1 -1
  195. package/lib/backtop/index.d.ts +75 -2
  196. package/lib/badge/Badge.css +1 -1
  197. package/lib/badge/Badge.d.ts +2 -22
  198. package/lib/badge/Badge.vue.cjs +1 -1
  199. package/lib/badge/Badge.vue2.cjs +1 -1
  200. package/lib/badge/index.cjs +1 -1
  201. package/lib/badge/index.d.ts +60 -3
  202. package/lib/breadcrumb/index.cjs +1 -1
  203. package/lib/breadcrumb/index.d.ts +44 -2
  204. package/lib/button/Button.d.ts +1 -1
  205. package/lib/button/index.cjs +1 -1
  206. package/lib/button/index.d.ts +74 -2
  207. package/lib/card/Card.vue2.cjs +1 -1
  208. package/lib/card/index.cjs +1 -1
  209. package/lib/card/index.d.ts +53 -2
  210. package/lib/carousel/Carousel.vue2.cjs +1 -1
  211. package/lib/carousel/index.cjs +1 -1
  212. package/lib/carousel/index.d.ts +116 -2
  213. package/lib/cascader/Cascader.d.ts +1 -1
  214. package/lib/cascader/Cascader.vue2.cjs +1 -1
  215. package/lib/cascader/index.cjs +1 -1
  216. package/lib/cascader/index.d.ts +77 -2
  217. package/lib/checkbox/index.cjs +1 -1
  218. package/lib/checkbox/index.d.ts +65 -2
  219. package/lib/collapse/Collapse.vue2.cjs +1 -1
  220. package/lib/collapse/index.cjs +1 -1
  221. package/lib/collapse/index.d.ts +122 -2
  222. package/lib/components.cjs +1 -1
  223. package/lib/components.d.ts +3 -3
  224. package/lib/countdown/index.cjs +1 -1
  225. package/lib/countdown/index.d.ts +70 -2
  226. package/lib/datepicker/index.cjs +1 -1
  227. package/lib/datepicker/index.d.ts +32 -2
  228. package/lib/descriptions/descriptions/index.cjs +1 -1
  229. package/lib/descriptions/descriptions/index.d.ts +48 -2
  230. package/lib/descriptions/descriptionsitem/index.cjs +1 -1
  231. package/lib/descriptions/descriptionsitem/index.d.ts +36 -2
  232. package/lib/dialog/Dialog.vue2.cjs +1 -1
  233. package/lib/dialog/index.cjs +1 -1
  234. package/lib/dialog/index.d.ts +115 -2
  235. package/lib/divider/index.cjs +1 -1
  236. package/lib/divider/index.d.ts +42 -2
  237. package/lib/drawer/Drawer.vue2.cjs +1 -1
  238. package/lib/drawer/index.cjs +1 -1
  239. package/lib/drawer/index.d.ts +94 -2
  240. package/lib/ellipsis/Ellipsis.d.ts +1 -120
  241. package/lib/ellipsis/Ellipsis.vue2.cjs +1 -1
  242. package/lib/ellipsis/index.cjs +1 -1
  243. package/lib/ellipsis/index.d.ts +54 -2
  244. package/lib/empty/index.cjs +1 -1
  245. package/lib/empty/index.d.ts +38 -2
  246. package/lib/flex/index.cjs +1 -1
  247. package/lib/flex/index.d.ts +39 -2
  248. package/lib/floatbutton/FloatButton.d.ts +1 -1
  249. package/lib/floatbutton/FloatButton.vue2.cjs +2 -2
  250. package/lib/floatbutton/index.cjs +1 -1
  251. package/lib/floatbutton/index.d.ts +90 -2
  252. package/lib/gradienttext/index.cjs +1 -1
  253. package/lib/gradienttext/index.d.ts +33 -2
  254. package/lib/grid/col/index.cjs +1 -1
  255. package/lib/grid/col/index.d.ts +105 -2
  256. package/lib/grid/row/index.cjs +1 -1
  257. package/lib/grid/row/index.d.ts +36 -2
  258. package/lib/image/Image.vue2.cjs +1 -1
  259. package/lib/image/index.cjs +1 -1
  260. package/lib/image/index.d.ts +72 -2
  261. package/lib/index.cjs +1 -1
  262. package/lib/index.d.ts +1 -0
  263. package/lib/input/index.cjs +1 -1
  264. package/lib/input/index.d.ts +86 -2
  265. package/lib/inputnumber/index.cjs +1 -1
  266. package/lib/inputnumber/index.d.ts +75 -2
  267. package/lib/inputsearch/InputSearch.vue2.cjs +1 -1
  268. package/lib/inputsearch/index.cjs +1 -1
  269. package/lib/inputsearch/index.d.ts +92 -2
  270. package/lib/list/list/List.vue2.cjs +1 -1
  271. package/lib/list/list/index.cjs +1 -1
  272. package/lib/list/list/index.d.ts +59 -2
  273. package/lib/list/listitem/ListItem.vue2.cjs +1 -1
  274. package/lib/list/listitem/index.cjs +1 -1
  275. package/lib/list/listitem/index.d.ts +62 -2
  276. package/lib/loadingbar/index.cjs +1 -1
  277. package/lib/loadingbar/index.d.ts +50 -2
  278. package/lib/message/index.cjs +1 -1
  279. package/lib/message/index.d.ts +62 -2
  280. package/lib/modal/Modal.vue2.cjs +1 -1
  281. package/lib/modal/index.cjs +1 -1
  282. package/lib/modal/index.d.ts +138 -2
  283. package/lib/notification/index.cjs +1 -1
  284. package/lib/notification/index.d.ts +63 -2
  285. package/lib/numberanimation/NumberAnimation.d.ts +1 -26
  286. package/lib/numberanimation/index.cjs +1 -1
  287. package/lib/numberanimation/index.d.ts +72 -3
  288. package/lib/pagination/Pagination.vue2.cjs +1 -1
  289. package/lib/pagination/index.cjs +1 -1
  290. package/lib/pagination/index.d.ts +78 -2
  291. package/lib/popconfirm/Popconfirm.d.ts +1 -120
  292. package/lib/popconfirm/Popconfirm.vue2.cjs +1 -1
  293. package/lib/popconfirm/index.cjs +1 -1
  294. package/lib/popconfirm/index.d.ts +86 -2
  295. package/lib/popover/Popover.vue2.cjs +1 -1
  296. package/lib/popover/index.cjs +1 -1
  297. package/lib/popover/index.d.ts +41 -2
  298. package/lib/progress/index.cjs +1 -1
  299. package/lib/progress/index.d.ts +58 -2
  300. package/lib/qrcode/index.cjs +1 -1
  301. package/lib/qrcode/index.d.ts +41 -2
  302. package/lib/radio/index.cjs +1 -1
  303. package/lib/radio/index.d.ts +75 -2
  304. package/lib/rate/Rate.vue2.cjs +1 -1
  305. package/lib/rate/index.cjs +1 -1
  306. package/lib/rate/index.d.ts +78 -2
  307. package/lib/result/index.cjs +1 -1
  308. package/lib/result/index.d.ts +40 -2
  309. package/lib/scrollbar/index.cjs +1 -1
  310. package/lib/scrollbar/index.d.ts +93 -2
  311. package/lib/segmented/index.cjs +1 -1
  312. package/lib/segmented/index.d.ts +54 -2
  313. package/lib/select/Select.vue2.cjs +1 -1
  314. package/lib/select/index.cjs +1 -1
  315. package/lib/select/index.d.ts +79 -2
  316. package/lib/skeleton/index.cjs +1 -1
  317. package/lib/skeleton/index.d.ts +45 -2
  318. package/lib/slider/index.cjs +1 -1
  319. package/lib/slider/index.d.ts +65 -2
  320. package/lib/space/index.cjs +1 -1
  321. package/lib/space/index.d.ts +36 -2
  322. package/lib/spin/index.cjs +1 -1
  323. package/lib/spin/index.d.ts +55 -2
  324. package/lib/statistic/index.cjs +1 -1
  325. package/lib/statistic/index.d.ts +48 -2
  326. package/lib/steps/index.cjs +1 -1
  327. package/lib/steps/index.d.ts +53 -2
  328. package/lib/swiper/index.cjs +1 -1
  329. package/lib/swiper/index.d.ts +68 -2
  330. package/lib/switch/index.cjs +1 -1
  331. package/lib/switch/index.d.ts +70 -2
  332. package/lib/table/Table.css +1 -1
  333. package/lib/table/Table.d.ts +6 -302
  334. package/lib/table/Table.vue.cjs +1 -1
  335. package/lib/table/Table.vue2.cjs +1 -1
  336. package/lib/table/index.cjs +1 -1
  337. package/lib/table/index.d.ts +308 -3
  338. package/lib/tabs/index.cjs +1 -1
  339. package/lib/tabs/index.d.ts +81 -2
  340. package/lib/tag/Tag.vue2.cjs +1 -1
  341. package/lib/tag/index.cjs +1 -1
  342. package/lib/tag/index.d.ts +73 -2
  343. package/lib/textarea/index.cjs +1 -1
  344. package/lib/textarea/index.d.ts +73 -2
  345. package/lib/textscroll/index.cjs +1 -1
  346. package/lib/textscroll/index.d.ts +78 -2
  347. package/lib/timeline/index.cjs +1 -1
  348. package/lib/timeline/index.d.ts +41 -2
  349. package/lib/timepicker/index.d.ts +1 -3
  350. package/lib/tooltip/index.cjs +1 -1
  351. package/lib/tooltip/index.d.ts +103 -2
  352. package/lib/upload/Upload.d.ts +2 -134
  353. package/lib/upload/Upload.vue2.cjs +1 -1
  354. package/lib/upload/index.cjs +1 -1
  355. package/lib/upload/index.d.ts +117 -2
  356. package/lib/utils/resolver.cjs +1 -0
  357. package/lib/utils/resolver.d.ts +8 -0
  358. package/lib/utils/type.cjs +1 -0
  359. package/lib/video/Video.css +1 -1
  360. package/lib/video/Video.vue.cjs +1 -1
  361. package/lib/video/Video.vue2.cjs +1 -1
  362. package/lib/video/index.cjs +1 -1
  363. package/lib/video/index.d.ts +80 -2
  364. package/lib/waterfall/Waterfall.vue2.cjs +1 -1
  365. package/lib/waterfall/index.cjs +1 -1
  366. package/lib/waterfall/index.d.ts +38 -2
  367. package/lib/watermark/index.cjs +1 -1
  368. package/lib/watermark/index.d.ts +54 -2
  369. package/package.json +14 -3
  370. package/es/timepicker/TimePicker.d.ts +0 -44
  371. 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
- ```bash
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).mount('#app')
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).mount('#app')
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
- ## Details
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">每个组件都是单文件组件 (SFC), 可以单独使用</p>
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
- ```bash
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).mount('#app')
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).mount('#app')
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