tt-design-web-vue 0.1.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 (227) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/README.md +120 -0
  3. package/dist/index.cjs +2 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.js +5220 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/rich-text.css +1 -0
  8. package/dist/style.cjs +2 -0
  9. package/dist/style.cjs.map +1 -0
  10. package/dist/style.css +1 -0
  11. package/dist/style.js +2 -0
  12. package/dist/style.js.map +1 -0
  13. package/dist/types/components/ActivityFeed/ActivityFeed.vue.d.ts +13 -0
  14. package/dist/types/components/ActivityFeed/index.d.ts +2 -0
  15. package/dist/types/components/Alert/Alert.vue.d.ts +164 -0
  16. package/dist/types/components/Alert/index.d.ts +1 -0
  17. package/dist/types/components/Anchor/Anchor.vue.d.ts +12 -0
  18. package/dist/types/components/Anchor/AnchorLink.vue.d.ts +14 -0
  19. package/dist/types/components/Anchor/index.d.ts +2 -0
  20. package/dist/types/components/AttachmentList/AttachmentList.vue.d.ts +19 -0
  21. package/dist/types/components/AttachmentList/index.d.ts +2 -0
  22. package/dist/types/components/Avatar/Avatar.vue.d.ts +153 -0
  23. package/dist/types/components/Avatar/AvatarGroup.vue.d.ts +208 -0
  24. package/dist/types/components/Avatar/avatar.d.ts +3 -0
  25. package/dist/types/components/Avatar/index.d.ts +6 -0
  26. package/dist/types/components/BackTop/BackTop.vue.d.ts +138 -0
  27. package/dist/types/components/BackTop/index.d.ts +1 -0
  28. package/dist/types/components/Badge/Badge.vue.d.ts +164 -0
  29. package/dist/types/components/Badge/index.d.ts +1 -0
  30. package/dist/types/components/Breadcrumb/Breadcrumb.vue.d.ts +108 -0
  31. package/dist/types/components/Breadcrumb/BreadcrumbItem.vue.d.ts +108 -0
  32. package/dist/types/components/Breadcrumb/index.d.ts +2 -0
  33. package/dist/types/components/Button/Button.vue.d.ts +12 -0
  34. package/dist/types/components/Button/index.d.ts +2 -0
  35. package/dist/types/components/Calendar/Calendar.vue.d.ts +205 -0
  36. package/dist/types/components/Calendar/index.d.ts +1 -0
  37. package/dist/types/components/Card/Card.vue.d.ts +179 -0
  38. package/dist/types/components/Card/index.d.ts +2 -0
  39. package/dist/types/components/CardSelect/CardSelect.vue.d.ts +56 -0
  40. package/dist/types/components/CardSelect/index.d.ts +2 -0
  41. package/dist/types/components/Carousel/Carousel.vue.d.ts +214 -0
  42. package/dist/types/components/Carousel/CarouselItem.vue.d.ts +112 -0
  43. package/dist/types/components/Carousel/index.d.ts +2 -0
  44. package/dist/types/components/Cascader/Cascader.vue.d.ts +704 -0
  45. package/dist/types/components/Cascader/index.d.ts +3 -0
  46. package/dist/types/components/Chart/Chart.vue.d.ts +47 -0
  47. package/dist/types/components/Chart/index.d.ts +2 -0
  48. package/dist/types/components/Checkbox/Checkbox.vue.d.ts +21 -0
  49. package/dist/types/components/Checkbox/CheckboxGroup.vue.d.ts +20 -0
  50. package/dist/types/components/Checkbox/index.d.ts +5 -0
  51. package/dist/types/components/Collapse/Collapse.vue.d.ts +150 -0
  52. package/dist/types/components/Collapse/CollapseItem.vue.d.ts +146 -0
  53. package/dist/types/components/Collapse/index.d.ts +2 -0
  54. package/dist/types/components/Color/Color.vue.d.ts +26 -0
  55. package/dist/types/components/Color/index.d.ts +2 -0
  56. package/dist/types/components/ColorPicker/ColorPicker.vue.d.ts +195 -0
  57. package/dist/types/components/ColorPicker/index.d.ts +3 -0
  58. package/dist/types/components/Comment/Comment.vue.d.ts +46 -0
  59. package/dist/types/components/Comment/index.d.ts +2 -0
  60. package/dist/types/components/Container/Container.vue.d.ts +12 -0
  61. package/dist/types/components/Container/index.d.ts +1 -0
  62. package/dist/types/components/DatePicker/DatePicker.vue.d.ts +568 -0
  63. package/dist/types/components/DatePicker/index.d.ts +3 -0
  64. package/dist/types/components/Descriptions/Descriptions.vue.d.ts +138 -0
  65. package/dist/types/components/Descriptions/DescriptionsItem.vue.d.ts +150 -0
  66. package/dist/types/components/Descriptions/index.d.ts +2 -0
  67. package/dist/types/components/Dialog/Dialog.vue.d.ts +360 -0
  68. package/dist/types/components/Dialog/index.d.ts +1 -0
  69. package/dist/types/components/Divider/Divider.vue.d.ts +123 -0
  70. package/dist/types/components/Divider/index.d.ts +1 -0
  71. package/dist/types/components/Drawer/Drawer.vue.d.ts +398 -0
  72. package/dist/types/components/Drawer/index.d.ts +1 -0
  73. package/dist/types/components/Dropdown/Dropdown.vue.d.ts +1610 -0
  74. package/dist/types/components/Dropdown/DropdownItem.vue.d.ts +12 -0
  75. package/dist/types/components/Dropdown/DropdownMenu.vue.d.ts +12 -0
  76. package/dist/types/components/Dropdown/index.d.ts +3 -0
  77. package/dist/types/components/EChartsWrapper/EChartsWrapper.vue.d.ts +39 -0
  78. package/dist/types/components/EChartsWrapper/index.d.ts +2 -0
  79. package/dist/types/components/Empty/Empty.vue.d.ts +126 -0
  80. package/dist/types/components/Empty/index.d.ts +1 -0
  81. package/dist/types/components/FilePreview/FilePreview.vue.d.ts +67 -0
  82. package/dist/types/components/FilePreview/index.d.ts +2 -0
  83. package/dist/types/components/FloatButton/FloatButton.vue.d.ts +44 -0
  84. package/dist/types/components/FloatButton/index.d.ts +2 -0
  85. package/dist/types/components/Font/Font.vue.d.ts +18 -0
  86. package/dist/types/components/Font/index.d.ts +2 -0
  87. package/dist/types/components/Form/Form.vue.d.ts +221 -0
  88. package/dist/types/components/Form/FormItem.vue.d.ts +17 -0
  89. package/dist/types/components/Form/index.d.ts +4 -0
  90. package/dist/types/components/Grid/Col.vue.d.ts +160 -0
  91. package/dist/types/components/Grid/Row.vue.d.ts +120 -0
  92. package/dist/types/components/Grid/index.d.ts +2 -0
  93. package/dist/types/components/Icon/Icon.vue.d.ts +30 -0
  94. package/dist/types/components/Icon/gradient.d.ts +10 -0
  95. package/dist/types/components/Icon/index.d.ts +1 -0
  96. package/dist/types/components/Image/Image.vue.d.ts +285 -0
  97. package/dist/types/components/Image/index.d.ts +1 -0
  98. package/dist/types/components/Input/Input.vue.d.ts +407 -0
  99. package/dist/types/components/Input/index.d.ts +2 -0
  100. package/dist/types/components/InputNumber/InputNumber.vue.d.ts +282 -0
  101. package/dist/types/components/InputNumber/index.d.ts +2 -0
  102. package/dist/types/components/Layout/Layout.vue.d.ts +27 -0
  103. package/dist/types/components/Layout/index.d.ts +1 -0
  104. package/dist/types/components/Link/Link.vue.d.ts +148 -0
  105. package/dist/types/components/Link/index.d.ts +1 -0
  106. package/dist/types/components/List/List.vue.d.ts +26 -0
  107. package/dist/types/components/List/ListItem.vue.d.ts +27 -0
  108. package/dist/types/components/List/index.d.ts +2 -0
  109. package/dist/types/components/Loading/Loading.vue.d.ts +12 -0
  110. package/dist/types/components/Loading/index.d.ts +3 -0
  111. package/dist/types/components/Masonry/Masonry.vue.d.ts +35 -0
  112. package/dist/types/components/Masonry/index.d.ts +2 -0
  113. package/dist/types/components/Menu/Menu.vue.d.ts +235 -0
  114. package/dist/types/components/Menu/MenuItem.vue.d.ts +295 -0
  115. package/dist/types/components/Menu/MenuItemGroup.vue.d.ts +14 -0
  116. package/dist/types/components/Menu/SubMenu.vue.d.ts +216 -0
  117. package/dist/types/components/Menu/index.d.ts +4 -0
  118. package/dist/types/components/Message/index.d.ts +9 -0
  119. package/dist/types/components/Money/Money.vue.d.ts +30 -0
  120. package/dist/types/components/Money/index.d.ts +2 -0
  121. package/dist/types/components/Notification/index.d.ts +9 -0
  122. package/dist/types/components/Pagination/Pagination.vue.d.ts +3 -0
  123. package/dist/types/components/Pagination/index.d.ts +1 -0
  124. package/dist/types/components/Plate/Plate.vue.d.ts +46 -0
  125. package/dist/types/components/Plate/index.d.ts +2 -0
  126. package/dist/types/components/Popconfirm/Popconfirm.vue.d.ts +23 -0
  127. package/dist/types/components/Popconfirm/index.d.ts +1 -0
  128. package/dist/types/components/Popover/Popover.vue.d.ts +19 -0
  129. package/dist/types/components/Popover/index.d.ts +1 -0
  130. package/dist/types/components/Progress/Progress.vue.d.ts +180 -0
  131. package/dist/types/components/Progress/index.d.ts +1 -0
  132. package/dist/types/components/QRCode/QRCode.vue.d.ts +43 -0
  133. package/dist/types/components/QRCode/index.d.ts +2 -0
  134. package/dist/types/components/QueryForm/QueryForm.vue.d.ts +227 -0
  135. package/dist/types/components/QueryForm/index.d.ts +1 -0
  136. package/dist/types/components/Radio/Radio.vue.d.ts +20 -0
  137. package/dist/types/components/Radio/RadioButton.vue.d.ts +12 -0
  138. package/dist/types/components/Radio/RadioGroup.vue.d.ts +20 -0
  139. package/dist/types/components/Radio/index.d.ts +6 -0
  140. package/dist/types/components/Rate/Rate.vue.d.ts +120 -0
  141. package/dist/types/components/Rate/index.d.ts +3 -0
  142. package/dist/types/components/Result/Result.vue.d.ts +136 -0
  143. package/dist/types/components/Result/index.d.ts +1 -0
  144. package/dist/types/components/RichText/RichText.vue.d.ts +42 -0
  145. package/dist/types/components/RichText/index.d.ts +2 -0
  146. package/dist/types/components/SearchFilter/SearchFilter.vue.d.ts +14 -0
  147. package/dist/types/components/SearchFilter/index.d.ts +1 -0
  148. package/dist/types/components/Segmented/Segmented.vue.d.ts +24 -0
  149. package/dist/types/components/Segmented/index.d.ts +3 -0
  150. package/dist/types/components/Select/Select.vue.d.ts +56 -0
  151. package/dist/types/components/Select/index.d.ts +3 -0
  152. package/dist/types/components/Skeleton/Skeleton.vue.d.ts +140 -0
  153. package/dist/types/components/Skeleton/SkeletonItem.vue.d.ts +26 -0
  154. package/dist/types/components/Skeleton/index.d.ts +2 -0
  155. package/dist/types/components/Space/Space.vue.d.ts +184 -0
  156. package/dist/types/components/Space/SpaceCompact.vue.d.ts +23 -0
  157. package/dist/types/components/Space/index.d.ts +579 -0
  158. package/dist/types/components/Spin/Spin.vue.d.ts +23 -0
  159. package/dist/types/components/Spin/index.d.ts +3 -0
  160. package/dist/types/components/Splitter/Splitter.vue.d.ts +146 -0
  161. package/dist/types/components/Splitter/SplitterPanel.vue.d.ts +144 -0
  162. package/dist/types/components/Splitter/index.d.ts +2 -0
  163. package/dist/types/components/Statistic/Statistic.vue.d.ts +158 -0
  164. package/dist/types/components/Statistic/index.d.ts +1 -0
  165. package/dist/types/components/Steps/Step.vue.d.ts +136 -0
  166. package/dist/types/components/Steps/Steps.vue.d.ts +148 -0
  167. package/dist/types/components/Steps/index.d.ts +2 -0
  168. package/dist/types/components/Switch/Switch.vue.d.ts +238 -0
  169. package/dist/types/components/Switch/index.d.ts +3 -0
  170. package/dist/types/components/Table/Table.vue.d.ts +38 -0
  171. package/dist/types/components/Table/TableColumn.vue.d.ts +4 -0
  172. package/dist/types/components/Table/TableOperationColumn.vue.d.ts +27 -0
  173. package/dist/types/components/Table/index.d.ts +3 -0
  174. package/dist/types/components/Tabs/TabPane.vue.d.ts +14 -0
  175. package/dist/types/components/Tabs/Tabs.vue.d.ts +19 -0
  176. package/dist/types/components/Tabs/index.d.ts +4 -0
  177. package/dist/types/components/Tag/CheckableTag.vue.d.ts +23 -0
  178. package/dist/types/components/Tag/Tag.vue.d.ts +150 -0
  179. package/dist/types/components/Tag/index.d.ts +479 -0
  180. package/dist/types/components/TimePicker/TimePicker.vue.d.ts +551 -0
  181. package/dist/types/components/TimePicker/index.d.ts +3 -0
  182. package/dist/types/components/Timeline/Timeline.vue.d.ts +60 -0
  183. package/dist/types/components/Timeline/TimelineItem.vue.d.ts +144 -0
  184. package/dist/types/components/Timeline/index.d.ts +2 -0
  185. package/dist/types/components/Tooltip/Tooltip.vue.d.ts +19 -0
  186. package/dist/types/components/Tooltip/index.d.ts +1 -0
  187. package/dist/types/components/TopicSwitch/TopicSwitch.vue.d.ts +36 -0
  188. package/dist/types/components/TopicSwitch/index.d.ts +3 -0
  189. package/dist/types/components/Tour/Tour.vue.d.ts +222 -0
  190. package/dist/types/components/Tour/index.d.ts +2 -0
  191. package/dist/types/components/Transfer/Transfer.vue.d.ts +29 -0
  192. package/dist/types/components/Transfer/index.d.ts +3 -0
  193. package/dist/types/components/Tree/Tree.vue.d.ts +5857 -0
  194. package/dist/types/components/Tree/index.d.ts +3 -0
  195. package/dist/types/components/TreeSelect/TreeSelect.vue.d.ts +990 -0
  196. package/dist/types/components/TreeSelect/index.d.ts +3 -0
  197. package/dist/types/components/Upload/Upload.vue.d.ts +322 -0
  198. package/dist/types/components/Upload/index.d.ts +3 -0
  199. package/dist/types/components/UserDisplay/UserDisplay.vue.d.ts +21 -0
  200. package/dist/types/components/UserDisplay/index.d.ts +1 -0
  201. package/dist/types/components/Watermark/Watermark.vue.d.ts +13 -0
  202. package/dist/types/components/Watermark/index.d.ts +1 -0
  203. package/dist/types/index.d.ts +119 -0
  204. package/dist/types/style.d.ts +0 -0
  205. package/dist/types/theme.d.ts +5 -0
  206. package/docs/component-compatibility.md +85 -0
  207. package/docs/component-manifest.json +100 -0
  208. package/docs/components/button.md +32 -0
  209. package/docs/components/chart.md +37 -0
  210. package/docs/components/container.md +28 -0
  211. package/docs/components/dialog.md +46 -0
  212. package/docs/components/echarts-wrapper.md +46 -0
  213. package/docs/components/form.md +67 -0
  214. package/docs/components/grid.md +32 -0
  215. package/docs/components/icon.md +45 -0
  216. package/docs/components/index.md +36 -0
  217. package/docs/components/loading.md +46 -0
  218. package/docs/components/message.md +26 -0
  219. package/docs/components/qr-code.md +49 -0
  220. package/docs/components/rich-text.md +65 -0
  221. package/docs/components/select.md +71 -0
  222. package/docs/components/table.md +44 -0
  223. package/docs/components/upload.md +40 -0
  224. package/docs/index.md +35 -0
  225. package/docs/migration-from-workspace.md +79 -0
  226. package/docs/theme.md +100 -0
  227. package/package.json +88 -0
@@ -0,0 +1,100 @@
1
+ {
2
+ "schemaVersion": "1.0",
3
+ "scope": "entry-export-compatibility",
4
+ "sources": {
5
+ "react": {
6
+ "reference": "tt-design/src/components/index.js",
7
+ "componentImportLines": "2-75",
8
+ "componentExportLines": "80-154",
9
+ "runtimeAliasLines": [77, 115]
10
+ },
11
+ "vue": {
12
+ "reference": "src/index.ts",
13
+ "runtimeExportLines": "1-114",
14
+ "typeOnlyExportLines": [2, 6, 8, 14, 17, 23, 28, 29, 32, 41, 43, 56, 59, 64, 69, 71, 74, 76, 79, 81, 84, 88, 90, 92, 97, 101, 104, 106, 108, 114]
15
+ }
16
+ },
17
+ "summary": {
18
+ "reactBaselineComponentCount": 74,
19
+ "reactPublicRuntimeExportCount": 75,
20
+ "vueRuntimeComponentExportCount": 109,
21
+ "vueDefaultReexports": 83,
22
+ "vueNamedRuntimeExports": 26,
23
+ "exactNameCount": 0,
24
+ "ttPrefixedMappingCount": 70,
25
+ "aliasCandidateCount": 2,
26
+ "missingCount": 1,
27
+ "nonEquivalentCount": 1
28
+ },
29
+ "mappingPolicy": {
30
+ "exact-name": "React 基线名称映射到 Vue 根入口的 Tt 前缀导出(例如 Button → TtButton);不表示 props、事件、插槽、静态方法或行为已验证。",
31
+ "alias-candidate": "入口名称不同但可作为候选迁移映射;必须进行 API 级复核。",
32
+ "missing": "React 基线导出在 Vue 根入口不存在。",
33
+ "non-equivalent": "存在相关能力,但公开导出结构不同,不能直接替换。"
34
+ },
35
+ "exactNameComponents": [
36
+ "Alert", "Anchor", "Avatar", "BackTop", "Badge", "Breadcrumb", "Button", "Calendar", "Card", "Carousel", "Checkbox", "Collapse", "Comment", "Color", "ColorPicker", "DatePicker", "Descriptions", "Divider", "Empty", "Drawer", "Dropdown", "FilePreview", "FloatButton", "Font", "Form", "Icon", "Image", "Input", "List", "Menu", "Masonry", "Message", "Money", "Notification", "Pagination", "Popconfirm", "Popover", "Progress", "Radio", "Layout", "Row", "Select", "Space", "Segmented", "Skeleton", "Spin", "Steps", "Switch", "Tag", "Timeline", "Tooltip", "Tour", "Tree", "Watermark", "InputNumber", "Cascader", "Splitter", "Table", "Tabs", "Rate", "Result", "Statistic", "CardSelect", "Upload", "QRCode", "Plate", "Chart", "TimePicker", "Transfer", "TreeSelect"
37
+ ],
38
+ "mappings": {
39
+ "aliasCandidates": [
40
+ {
41
+ "react": "A",
42
+ "vue": "Link",
43
+ "reactLine": 80,
44
+ "vueLine": 50,
45
+ "note": "AnchorLink 是 Anchor 的 Vue 命名子组件导出,不是 A 的对应项。"
46
+ },
47
+ {
48
+ "react": "Modal",
49
+ "vue": "Dialog",
50
+ "reactLine": 116,
51
+ "vueLine": 34,
52
+ "note": "需要验证 props、静态方法和受控行为。"
53
+ }
54
+ ],
55
+ "missing": [
56
+ {
57
+ "react": "ScriptEditor",
58
+ "reactLine": 110,
59
+ "vue": null,
60
+ "note": "Vue 入口没有对应运行时导出。"
61
+ }
62
+ ],
63
+ "nonEquivalent": [
64
+ {
65
+ "react": "Grid",
66
+ "reactLine": 106,
67
+ "vue": ["Row", "Col"],
68
+ "vueLine": 45,
69
+ "note": "Vue 未导出顶层 Grid;Row 可独立精确映射 React Row,Col 是 Vue 的额外公开导出。"
70
+ }
71
+ ]
72
+ },
73
+ "reactNonComponentRuntimeExports": [
74
+ {
75
+ "name": "message",
76
+ "aliasOf": "Message",
77
+ "declarationLine": 77,
78
+ "exportLine": 115,
79
+ "vueEquivalent": null,
80
+ "note": "Vue 只导出大写 Message,不能自动标为小写 message API 的等价物。"
81
+ }
82
+ ],
83
+ "vueOnly": {
84
+ "defaultExtensions": [
85
+ {"name": "TtActivityFeed", "line": 1, "category": "business/domain candidate"},
86
+ {"name": "TtAttachmentList", "line": 6, "category": "business/domain candidate"},
87
+ {"name": "TtContainer", "line": 29, "category": "Element Plus layout container"},
88
+ {"name": "TtEChartsWrapper", "line": 22, "category": "chart adapter/extension"},
89
+ {"name": "TtLoading", "line": 89, "category": "Element Plus loading container"},
90
+ {"name": "TtQueryForm", "line": 67, "category": "business/domain candidate"},
91
+ {"name": "TtRichText", "line": 75, "category": "WangEditor rich-text editor"},
92
+ {"name": "TtSearchFilter", "line": 77, "category": "business/domain candidate"},
93
+ {"name": "TtTopicSwitch", "line": 100, "category": "business/domain candidate"},
94
+ {"name": "TtUserDisplay", "line": 110, "category": "business/domain candidate"}
95
+ ],
96
+ "namedCompositeOrSubcomponentExports": [
97
+ {"name": "TtAnchorLink", "line": 4}, {"name": "TtAvatarGroup", "line": 7}, {"name": "TtBreadcrumbItem", "line": 11}, {"name": "TtCarouselItem", "line": 19}, {"name": "TtCheckboxGroup", "line": 22}, {"name": "TtCollapseItem", "line": 30}, {"name": "TtDescriptionsItem", "line": 33}, {"name": "TtDropdownItem", "line": 37}, {"name": "TtDropdownMenu", "line": 37}, {"name": "TtFormItem", "line": 44}, {"name": "TtCol", "line": 45}, {"name": "TtListItem", "line": 49}, {"name": "TtMenuItem", "line": 57}, {"name": "TtMenuItemGroup", "line": 57}, {"name": "TtSubMenu", "line": 57}, {"name": "TtRadioButton", "line": 70}, {"name": "TtRadioGroup", "line": 70}, {"name": "TtSkeletonItem", "line": 82}, {"name": "TtSplitterPanel", "line": 85}, {"name": "TtTableColumn", "line": 93}, {"name": "TtTableOperationColumn", "line": 93}, {"name": "TtTabPane", "line": 94}, {"name": "TtTimelineItem", "line": 98}, {"name": "TtTourStep", "line": 102}, {"name": "TtStep", "line": 113}
98
+ ]
99
+ }
100
+ }
@@ -0,0 +1,32 @@
1
+ # Button
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtButton } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <template>
13
+ <tt-button>默认按钮</tt-button>
14
+ <tt-button type="primary">主要操作</tt-button>
15
+ <tt-button type="primary" disabled>不可用</tt-button>
16
+ </template>
17
+ ```
18
+
19
+ 可交互预览、参数 Controls 与完整状态示例见本地 Storybook:`yarn storybook`。
20
+
21
+ ## API
22
+
23
+ `TtButton` 是 `ElButton` 的样式封装,根节点使用 `tt-button` 类名。
24
+
25
+ | 项目 | 说明 |
26
+ | --- | --- |
27
+ | Props | 源码未显式声明。传入的属性通过 `$attrs` 原样透传给 `ElButton`。 |
28
+ | Events | 源码未显式声明;由 `ElButton` 的透传行为决定。 |
29
+ | Slots | `default`。 |
30
+ | Expose | 无。 |
31
+
32
+ Element Plus 原生属性的可用范围以宿主使用的 Element Plus 版本文档为准。
@@ -0,0 +1,37 @@
1
+ # Chart 图表
2
+
3
+ 基于 ECharts 的通用图表组件,支持折线、柱状、饼图、散点、雷达、仪表、漏斗、桑基、树图、热力图及 ECharts 的其他图表配置。
4
+
5
+ ```vue
6
+ <script setup lang="ts">
7
+ import { TtChart } from 'tt-design-web-vue';
8
+
9
+ const option = {
10
+ xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
11
+ yAxis: { type: 'value' },
12
+ series: [{ type: 'line', data: [120, 200, 150] }],
13
+ };
14
+ </script>
15
+
16
+ <template>
17
+ <tt-chart :option="option" theme="geekBlue" :height="360" />
18
+ </template>
19
+ ```
20
+
21
+ ## API
22
+
23
+ | 属性 | 说明 | 类型 | 默认值 |
24
+ | --- | --- | --- | --- |
25
+ | option | ECharts 配置项 | `EChartsOption` | 必填 |
26
+ | theme | TT 预设主题名或 ECharts 主题对象 | `ChartTheme` | `geekBlue` |
27
+ | height | 图表高度 | `number \| string` | `300` |
28
+ | loading | 是否显示加载层 | `boolean` | `false` |
29
+ | loadingOptions | ECharts 加载配置 | `object` | `{}` |
30
+ | onEvents | ECharts 事件映射 | `Record<string, Function>` | `{}` |
31
+ | notMerge | 更新时是否不合并旧配置 | `boolean` | `false` |
32
+ | lazyUpdate | 是否延迟更新 | `boolean` | `false` |
33
+ | autoResize | 是否随容器尺寸缩放 | `boolean` | `true` |
34
+
35
+ ## 实例方法
36
+
37
+ 通过组件 `ref` 可调用 `getEchartsInstance`、`resize`、`setOption`、`dispatchAction`、`convertToPixel` 与 `convertFromPixel`。
@@ -0,0 +1,28 @@
1
+ # Container 容器
2
+
3
+ `TtContainer` 是 Element Plus `ElContainer` 的薄包装,用于组织页面的头部、侧栏、主内容与底部区域。
4
+
5
+ ```ts
6
+ import { TtContainer } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <template>
13
+ <tt-container direction="vertical">
14
+ <el-header>顶部</el-header>
15
+ <el-main>内容</el-main>
16
+ <el-footer>底部</el-footer>
17
+ </tt-container>
18
+ </template>
19
+ ```
20
+
21
+ ## API
22
+
23
+ | 项目 | 说明 |
24
+ | --- | --- |
25
+ | Props | 本组件未显式声明属性,`$attrs` 透传至当前 Element Plus 的 `ElContainer`,包括 `direction`。 |
26
+ | Slots | `default`。 |
27
+
28
+ Element Plus 的完整属性和子区域组件以宿主使用的 Element Plus 版本为准。
@@ -0,0 +1,46 @@
1
+ # Dialog
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtDialog } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ import { ref } from 'vue';
14
+ import { TtButton, TtDialog } from 'tt-design-web-vue';
15
+
16
+ const visible = ref(false);
17
+ </script>
18
+
19
+ <template>
20
+ <tt-button type="primary" @click="visible = true">打开弹窗</tt-button>
21
+ <tt-dialog v-model="visible" title="确认操作" width="420px">
22
+ 内容
23
+ <template #footer>
24
+ <tt-button @click="visible = false">取消</tt-button>
25
+ <tt-button type="primary" @click="visible = false">确认</tt-button>
26
+ </template>
27
+ </tt-dialog>
28
+ </template>
29
+ ```
30
+
31
+ 可交互预览、受控开关与头部/底部插槽示例见本地 Storybook:`yarn storybook`。
32
+
33
+ ## API
34
+
35
+ | 类别 | 名称 | 类型 / 说明 |
36
+ | --- | --- | --- |
37
+ | Prop | `modelValue` | `boolean`,用于控制内部 `ElDialog` 的 `v-model`。 |
38
+ | Event | `update:modelValue` | 由 `defineModel` 提供。 |
39
+ | Slot | `header` | 转发 Element Plus header slot 的 slot props。 |
40
+ | Slot | `default` | 弹窗主体内容。 |
41
+ | Slot | `footer` | 弹窗底部内容。 |
42
+ | Expose | `dialogRef` | 内部 Dialog 实例引用。 |
43
+
44
+ 组件未暴露 `open()`、`close()` 等实例方法,也未定义服务式 Dialog API。其他属性通过 `$attrs` 透传给 `ElDialog`。
45
+
46
+ **源码依据**:`src/components/Dialog/Dialog.vue:2-27`;`src/components/Dialog/index.ts:1`;`src/index.ts:33`。
@@ -0,0 +1,46 @@
1
+ # EChartsWrapper
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtEChartsWrapper } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ import { TtEChartsWrapper } from 'tt-design-web-vue';
14
+
15
+ const option = {
16
+ xAxis: { type: 'category', data: ['A'] },
17
+ yAxis: { type: 'value' },
18
+ series: [{ type: 'line', data: [1] }],
19
+ };
20
+ </script>
21
+
22
+ <template>
23
+ <tt-e-charts-wrapper :option="option" />
24
+ </template>
25
+ ```
26
+
27
+ ## Props
28
+
29
+ | 名称 | 类型 | 默认值 | 说明 |
30
+ | --- | --- | --- | --- |
31
+ | `option` | `EChartsOption` | — | 必填。初始化时通过 `setOption` 写入,并被深度监听以更新图表。 |
32
+ | `height` | `number \| string` | `300` | 图表容器高度;数字值会转换为像素。 |
33
+
34
+ ## 生命周期与 API
35
+
36
+ | 类别 | 项目 | 说明 |
37
+ | --- | --- | --- |
38
+ | Events | — | 源码未声明 emits。 |
39
+ | Slots | — | 源码未声明 slots。 |
40
+ | Expose | — | 未暴露图表 instance、初始化、更新或 resize 方法。 |
41
+ | 内部行为 | 图表模块 | 内部注册柱状、折线、饼图、散点图及常用 ECharts 组件,渲染器为 Canvas。 |
42
+ | 内部行为 | 清理 | 自动监听尺寸变化,并在组件卸载时销毁图表实例。 |
43
+
44
+ 如需直接调用 ECharts 实例方法,当前组件没有公开 expose;这是后续 API 扩展项。
45
+
46
+ **源码依据**:`src/components/EChartsWrapper/EChartsWrapper.vue:2,5-90`;`src/components/EChartsWrapper/index.ts:1`;`src/index.ts:21`。
@@ -0,0 +1,67 @@
1
+ # Form
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtForm, TtFormItem } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ import { ref } from 'vue';
14
+ import { TtButton, TtForm, TtFormItem, TtInput } from 'tt-design-web-vue';
15
+
16
+ const name = ref('');
17
+ </script>
18
+
19
+ <template>
20
+ <tt-form label-width="72px">
21
+ <tt-form-item label="名称">
22
+ <tt-input v-model="name" placeholder="请输入名称" />
23
+ </tt-form-item>
24
+ <tt-form-item>
25
+ <tt-button type="primary">保存</tt-button>
26
+ </tt-form-item>
27
+ </tt-form>
28
+ </template>
29
+ ```
30
+
31
+ 可交互预览、组合表单与标签插槽示例见本地 Storybook:`yarn storybook`。
32
+
33
+ ## Form API
34
+
35
+ `TtForm` 将未显式声明的属性透传至 `ElForm`。
36
+
37
+ | 项目 | 说明 |
38
+ | --- | --- |
39
+ | Props | 源码未显式声明;通过 `$attrs` 透传给 `ElForm`。 |
40
+ | Events | 源码未显式声明。 |
41
+ | Slots | `default`。 |
42
+ | Expose | `formRef`、`validate(...unknown[])`、`validateField(...unknown[])`、`resetFields(...unknown[])`、`clearValidate(...unknown[])`、`scrollToField(...unknown[])`。 |
43
+
44
+ 暴露的方法会通过可选链调用内部 Element Plus 表单实例;其返回类型与完整参数规则由当前 Element Plus 版本决定。
45
+
46
+ ```ts
47
+ formRef.value?.resetFields();
48
+ ```
49
+
50
+ ## FormItem API
51
+
52
+ `TtFormItem` 将未显式声明的属性透传至 `ElFormItem`。
53
+
54
+ | 项目 | 说明 |
55
+ | --- | --- |
56
+ | Props | 源码未显式声明;通过 `$attrs` 透传给 `ElFormItem`。 |
57
+ | Events | 源码未显式声明。 |
58
+ | Slots | `default`、`label`、`error`。 |
59
+ | Expose | 无。 |
60
+
61
+ ```vue
62
+ <tt-form-item>
63
+ <template #label>名称</template>
64
+ </tt-form-item>
65
+ ```
66
+
67
+ **源码依据**:`src/components/Form/Form.vue:2,7-44`;`src/components/Form/FormItem.vue:2-22`;`src/components/Form/index.ts:1-5`;`src/index.ts:43`。
@@ -0,0 +1,32 @@
1
+ # Grid
2
+
3
+ Vue 当前没有名为 `Grid` 的默认组件。根入口仅提供 `Row` 和 `Col`:
4
+
5
+ ```ts
6
+ import { TtRow, TtCol } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ 这与 React 基线的顶层 `Grid` 不等价,详见 [组件兼容清单](../component-compatibility#需单独验证的映射)。
10
+
11
+ ## 示例
12
+
13
+ ```vue
14
+ <template>
15
+ <tt-row>
16
+ <tt-col>内容</tt-col>
17
+ </tt-row>
18
+ </template>
19
+ ```
20
+
21
+ ## Row 与 Col API
22
+
23
+ | 项目 | Row | Col |
24
+ | --- | --- | --- |
25
+ | Props | 源码未显式声明;`$attrs` 透传 `ElRow`。 | 源码未显式声明;`$attrs` 透传 `ElCol`。 |
26
+ | Events | 源码未显式声明。 | 源码未显式声明。 |
27
+ | Slots | `default`。 | `default`。 |
28
+ | Expose | `rowRef`。 | `colRef`。 |
29
+
30
+ Element Plus 的行列属性由宿主所使用的 Element Plus 版本决定。
31
+
32
+ **源码依据**:`src/components/Grid/Row.vue:2-19`;`src/components/Grid/Col.vue:2-19`;`src/components/Grid/index.ts:1-2`;`src/index.ts:44`。
@@ -0,0 +1,45 @@
1
+ # Icon
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtIcon } from 'tt-design-web-vue';
7
+ ```
8
+
9
+ ## 示例
10
+
11
+ ```vue
12
+ <script setup lang="ts">
13
+ import { Star } from '@element-plus/icons-vue';
14
+ import { TtIcon } from 'tt-design-web-vue';
15
+ </script>
16
+
17
+ <template>
18
+ <tt-icon :icon="Star" size="28" color="linear-gradient(135deg, #667eea 0%, #764ba2 100%)" />
19
+ <tt-icon iconfont="iconfont icon-search" size="28" color="#3388ff" label="搜索" />
20
+ </template>
21
+ ```
22
+
23
+ `iconfont` 传入的是已加载 Iconfont 样式表中的类名;图标字体文件与 CSS 由宿主项目自行引入。
24
+
25
+ ## Props
26
+
27
+ | 名称 | 类型 | 默认值 | 说明 |
28
+ | --- | --- | --- | --- |
29
+ | `icon` | `Component \| string` | — | Element Plus 图标组件或字符串回退内容。 |
30
+ | `iconfont` | `string` | `''` | Iconfont 的 CSS 类名,可包含多个类名。 |
31
+ | `size` | `number \| string` | — | 透传给 `ElIcon` 的图标尺寸。 |
32
+ | `color` | `string` | — | 普通 CSS 颜色;传入 `linear-gradient(...)` 或 `radial-gradient(...)` 时渲染渐变色。 |
33
+ | `spin` | `boolean` | `false` | 是否持续旋转。 |
34
+ | `inline` | `boolean` | `true` | 是否以内联方式展示。 |
35
+ | `label` | `string` | `''` | 无障碍标签;设置后渲染为 `aria-label`。 |
36
+
37
+ ## 插槽
38
+
39
+ | 名称 | 说明 |
40
+ | --- | --- |
41
+ | `default` | 自定义图标内容;优先于 `icon` 与 `iconfont`。 |
42
+
43
+ 未显式声明的属性会通过 `$attrs` 透传给 `ElIcon`。
44
+
45
+ **源码依据**:`src/components/Icon/Icon.vue`;`src/components/Icon/index.ts`;`src/index.ts`。
@@ -0,0 +1,36 @@
1
+ # 组件
2
+
3
+ 首批组件页面以迁入后的 `src/` 为事实来源,记录公开导出、props、事件、插槽与实例方法。无法从源码确认的能力不会在文档中推断。
4
+
5
+ 需要查看真实组件、调节 Props Controls 或检查不同状态时,在项目根目录运行 `yarn storybook`;VitePress 页面只保留可复制的最小用法与 API 边界。
6
+
7
+ ## 表单与输入
8
+
9
+ - [Button](./button)
10
+ - [Form](./form)
11
+ - [Select](./select)
12
+ - [Upload](./upload)
13
+ - [RichText](./rich-text)
14
+
15
+ ## 数据展示与布局
16
+
17
+ - [Icon](./icon)
18
+ - [Table](./table)
19
+ - [Grid](./grid)
20
+ - [Container](./container)
21
+ - [EChartsWrapper](./echarts-wrapper)
22
+ - [Chart](./chart)
23
+ - [QRCode](./qr-code)
24
+
25
+ ## 反馈
26
+
27
+ - [Dialog](./dialog)
28
+ - [Loading](./loading)
29
+ - [Message](./message)
30
+
31
+ ## 使用约定
32
+
33
+ 1. 组件统一从 `tt-design-web-vue` 根入口按需导入。
34
+ 2. 宿主先加载 `element-plus/dist/index.css`,再加载 `tt-design-web-vue/style.css`。
35
+ 3. wrapper 未显式声明的属性通常通过 `$attrs` 透传给 Element Plus;具体可用属性以当前 Element Plus 版本文档为准。
36
+ 4. 本库的公开 API 仍以 `src/index.ts` 为准;子组件和类型导出会在对应页面中单独标出。
@@ -0,0 +1,46 @@
1
+ # Loading
2
+
3
+ `TtLoading` 是 Element Plus Loading 的 Vue 容器组件。它只提供 `.tt-loading` 根节点和 `$attrs` 透传,不定义自研加载属性;加载状态仍由 Element Plus 的 `v-loading` 指令控制。
4
+
5
+ ## 局部加载
6
+
7
+ ```vue
8
+ <script setup lang="ts">
9
+ import { ref } from 'vue';
10
+ import { TtLoading } from 'tt-design-web-vue';
11
+
12
+ const loading = ref(true);
13
+ </script>
14
+
15
+ <template>
16
+ <tt-loading v-loading="loading" element-loading-text="正在加载">
17
+ 内容区域
18
+ </tt-loading>
19
+ </template>
20
+ ```
21
+
22
+ `v-loading` 支持 Element Plus 当前版本提供的 `element-loading-text`、`element-loading-background`、`element-loading-spinner` 等指令属性。
23
+
24
+ ## 全屏加载
25
+
26
+ ```ts
27
+ import { ElLoadingService } from 'tt-design-web-vue';
28
+
29
+ const instance = ElLoadingService({
30
+ lock: true,
31
+ text: '正在加载',
32
+ background: 'rgba(255, 255, 255, 0.72)',
33
+ });
34
+
35
+ instance.close();
36
+ ```
37
+
38
+ ## API
39
+
40
+ | 导出 | 说明 |
41
+ | --- | --- |
42
+ | `TtLoading` | Element Plus Loading 的 Vue 容器组件;指令和服务仍通过 `ElLoadingDirective`、`ElLoadingService` 使用。 |
43
+ | `ElLoadingDirective` | Element Plus 的 `v-loading` 指令。 |
44
+ | `ElLoadingService(options)` | 创建 Loading 实例,返回的实例可调用 `close()`。 |
45
+
46
+ `LoadingOptions`、`LoadingInstance`、`LoadingOptionsResolved` 和 `LoadingParentElement` 类型也从根入口导出;具体参数和默认行为以当前 Element Plus 版本为准。
@@ -0,0 +1,26 @@
1
+ # Message
2
+
3
+ `TtMessage` 是服务式反馈 API,而不是 Vue SFC。
4
+
5
+ ```ts
6
+ import { TtMessage } from 'tt-design-web-vue';
7
+
8
+ TtMessage('保存成功');
9
+ ```
10
+
11
+ ## API
12
+
13
+ | 方法 | 参数 | 说明 |
14
+ | --- | --- | --- |
15
+ | `TtMessage(options)` | `string \| number \| boolean \| Record<string, any>` | 创建默认类型消息。标量会规范化为 `{ type, message, customClass: 'tt-message' }`。 |
16
+ | `TtMessage.success(options)` | 同上 | 创建成功消息。 |
17
+ | `TtMessage.warning(options)` | 同上 | 创建警告消息。 |
18
+ | `TtMessage.info(options)` | 同上 | 创建信息消息。 |
19
+ | `TtMessage.error(options)` | 同上 | 创建错误消息。 |
20
+ | `TtMessage.closeAll()` | — | 转发 `ElMessage.closeAll`。 |
21
+
22
+ 对象参数会被展开,并与 TT 默认 `customClass` 合并。底层 `ElMessage` 的完整配置与返回 handler 类型由当前 Element Plus 版本决定。
23
+
24
+ `TtMessage` 不具有 props、emits、slots 或 Vue 实例 expose。
25
+
26
+ **源码依据**:`src/components/Message/index.ts:6-35`;`src/index.ts:52`。
@@ -0,0 +1,49 @@
1
+ # QRCode
2
+
3
+ 从根入口导入:
4
+
5
+ ```ts
6
+ import { TtQRCode } from 'tt-design-web-vue';
7
+ import type { QRCodeLevel, QRCodeStatus } from 'tt-design-web-vue';
8
+ ```
9
+
10
+ ## 示例
11
+
12
+ ```vue
13
+ <template>
14
+ <tt-q-r-code value="https://example.com" />
15
+ </template>
16
+ ```
17
+
18
+ ## Props
19
+
20
+ | 名称 | 类型 | 默认值 | 说明 |
21
+ | --- | --- | --- | --- |
22
+ | `value` | `string` | `''` | 二维码内容;为空时会清除生成的 data URL。 |
23
+ | `size` | `number` | `156` | CSS 变量和二维码生成宽高。 |
24
+ | `level` | `QRCodeLevel` | `'M'` | 纠错等级。 |
25
+ | `status` | `QRCodeStatus` | `'active'` | 控制正常、加载、过期状态。 |
26
+ | `bordered` | `boolean` | `true` | 是否添加边框样式。 |
27
+ | `description` | `string` | `''` | 描述文本的后备内容。 |
28
+ | `refreshText` | `string` | `'刷新'` | 过期状态刷新按钮的文案。 |
29
+ | `alt` | `string` | `''` | 图片替代文本;为空时使用 `QRCode: ${value}`。 |
30
+
31
+ ```ts
32
+ export type QRCodeLevel = 'L' | 'M' | 'Q' | 'H';
33
+ export type QRCodeStatus = 'active' | 'expired' | 'loading';
34
+ ```
35
+
36
+ ## Events、插槽与实例方法
37
+
38
+ | 类别 | 项目 | 说明 |
39
+ | --- | --- | --- |
40
+ | Event | `refresh` | 过期态默认刷新按钮会触发该事件。 |
41
+ | Slot | `loading` | 加载状态内容;默认文案为“生成中”。 |
42
+ | Slot | `expired` | 过期状态内容及刷新区域。 |
43
+ | Slot | `icon` | 二维码中央图标。 |
44
+ | Slot | `description` | 描述内容;优先于 `description` prop。 |
45
+ | Expose | — | 无。`toDataURL` 仅在内部 watcher 中调用。 |
46
+
47
+ 未显式声明的额外属性会通过 `$attrs` 透传到外层容器。
48
+
49
+ **源码依据**:`src/components/QRCode/QRCode.vue:2-88`;`src/components/QRCode/index.ts:1-2`;`src/index.ts:67-68`。
@@ -0,0 +1,65 @@
1
+ # RichText 富文本编辑器
2
+
3
+ `TtRichText` 基于 WangEditor 开发,提供完整的富文本工具栏与编辑能力,并使用 TT Design 的视觉样式。
4
+
5
+ 从根入口导入:
6
+
7
+ ```ts
8
+ import { TtRichText } from 'tt-design-web-vue';
9
+ import type { RichTextTool } from 'tt-design-web-vue';
10
+ // wangEditor 基础样式未包含在全量 style.css 中,使用 RichText 时需额外引入:
11
+ import 'tt-design-web-vue/rich-text.css';
12
+ ```
13
+
14
+ > wangEditor 为浏览器专属依赖,TtRichText 在组件挂载后才动态加载它;SSR/Node 环境导入包入口不会触发加载,也不会因 `global.navigator` 报错。
15
+
16
+ ## 示例
17
+
18
+ ```vue
19
+ <script setup lang="ts">
20
+ import { ref } from 'vue';
21
+ import { TtRichText } from 'tt-design-web-vue';
22
+
23
+ const content = ref('<p>请输入内容...</p>');
24
+ </script>
25
+
26
+ <template>
27
+ <tt-rich-text v-model="content" placeholder="请输入内容..." style="max-width: 720px" />
28
+ </template>
29
+ ```
30
+
31
+ 可交互预览、工具栏组合和只读状态见本地 Storybook:`yarn storybook`。
32
+
33
+ ## Props
34
+
35
+ | 名称 | 类型 | 默认值 | 说明 |
36
+ | --- | --- | --- | --- |
37
+ | `modelValue` | `string` | `''` | 编辑器 HTML 内容,支持 `v-model`。 |
38
+ | `placeholder` | `string` | `'请输入内容...'` | 空内容时的占位文案。 |
39
+ | `disabled` | `boolean` | `false` | 是否禁用编辑和工具栏。 |
40
+ | `readonly` | `boolean` | `false` | 是否以只读方式展示内容;只读时不显示工具栏。 |
41
+ | `minHeight` | `number \| string` | `200` | 编辑区域最小高度;数值按 px 处理。 |
42
+ | `toolbar` | `RichTextTool[]` | — | 自定义精简工具栏;未传入时使用 WangEditor 默认工具栏,`divider` 为分隔线。 |
43
+
44
+ ```ts
45
+ export type RichTextTool =
46
+ | 'bold' | 'italic' | 'underline' | 'strike'
47
+ | 'heading1' | 'heading2'
48
+ | 'unorderedList' | 'orderedList'
49
+ | 'alignLeft' | 'alignCenter' | 'alignRight'
50
+ | 'link' | 'removeFormat' | 'divider';
51
+ ```
52
+
53
+ ## Events 与实例方法
54
+
55
+ | 类别 | 项目 | 说明 |
56
+ | --- | --- | --- |
57
+ | Event | `update:modelValue` | 编辑内容变化时由 `defineModel` 触发。 |
58
+ | Event | `change` | 编辑内容变化时触发,参数为 HTML 字符串。 |
59
+ | Event | `focus` / `blur` | 编辑区获得或失去焦点时触发。 |
60
+ | Event | `clear` | 调用 `clear()` 清空成功后触发。 |
61
+ | Expose | `focus()` / `blur()` | 控制编辑区焦点。 |
62
+ | Expose | `clear()` | 清空编辑器内容。 |
63
+ | Expose | `getHtml()` / `setHtml(value)` | 读取或更新当前 HTML 内容。 |
64
+
65
+ **源码依据**:`src/components/RichText/RichText.vue`、`src/components/RichText/index.ts`、`src/index.ts`。