ep-craft 0.1.42 → 0.2.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/dist-ai/components/affix.json +152 -0
- package/dist-ai/components/affix.md +73 -0
- package/dist-ai/components/alert.json +186 -0
- package/dist-ai/components/alert.md +89 -0
- package/dist-ai/components/anchor-link.json +102 -0
- package/dist-ai/components/anchor-link.md +67 -0
- package/dist-ai/components/anchor.json +179 -0
- package/dist-ai/components/anchor.md +87 -0
- package/dist-ai/components/aside.json +87 -0
- package/dist-ai/components/aside.md +63 -0
- package/dist-ai/components/autocomplete.json +613 -0
- package/dist-ai/components/autocomplete.md +140 -0
- package/dist-ai/components/avatar.json +163 -0
- package/dist-ai/components/avatar.md +83 -0
- package/dist-ai/components/backtop.json +118 -0
- package/dist-ai/components/backtop.md +66 -0
- package/dist-ai/components/badge.json +186 -0
- package/dist-ai/components/badge.md +85 -0
- package/dist-ai/components/breadcrumb-item.json +97 -0
- package/dist-ai/components/breadcrumb-item.md +65 -0
- package/dist-ai/components/breadcrumb.json +100 -0
- package/dist-ai/components/breadcrumb.md +68 -0
- package/dist-ai/components/button-group.json +123 -0
- package/dist-ai/components/button-group.md +65 -0
- package/dist-ai/components/button.json +349 -0
- package/dist-ai/components/button.md +124 -0
- package/dist-ai/components/calendar.json +148 -0
- package/dist-ai/components/calendar.md +74 -0
- package/dist-ai/components/card.json +168 -0
- package/dist-ai/components/card.md +87 -0
- package/dist-ai/components/carousel-item.json +99 -0
- package/dist-ai/components/carousel-item.md +68 -0
- package/dist-ai/components/carousel.json +245 -0
- package/dist-ai/components/carousel.md +97 -0
- package/dist-ai/components/cascader-panel.json +242 -0
- package/dist-ai/components/cascader-panel.md +108 -0
- package/dist-ai/components/cascader.json +531 -0
- package/dist-ai/components/cascader.md +146 -0
- package/dist-ai/components/check-tag.json +133 -0
- package/dist-ai/components/check-tag.md +72 -0
- package/dist-ai/components/checkbox-button.json +279 -0
- package/dist-ai/components/checkbox-button.md +94 -0
- package/dist-ai/components/checkbox-group.json +236 -0
- package/dist-ai/components/checkbox-group.md +90 -0
- package/dist-ai/components/checkbox.json +278 -0
- package/dist-ai/components/checkbox.md +91 -0
- package/dist-ai/components/col.json +168 -0
- package/dist-ai/components/col.md +72 -0
- package/dist-ai/components/collapse-item.json +133 -0
- package/dist-ai/components/collapse-item.md +75 -0
- package/dist-ai/components/collapse-transition.json +75 -0
- package/dist-ai/components/collapse-transition.md +59 -0
- package/dist-ai/components/collapse.json +129 -0
- package/dist-ai/components/collapse.md +76 -0
- package/dist-ai/components/color-picker.json +280 -0
- package/dist-ai/components/color-picker.md +85 -0
- package/dist-ai/components/config-provider.json +222 -0
- package/dist-ai/components/config-provider.md +76 -0
- package/dist-ai/components/container.json +95 -0
- package/dist-ai/components/container.md +70 -0
- package/dist-ai/components/countdown.json +155 -0
- package/dist-ai/components/countdown.md +73 -0
- package/dist-ai/components/date-picker-panel.json +346 -0
- package/dist-ai/components/date-picker-panel.md +91 -0
- package/dist-ai/components/date-picker.json +574 -0
- package/dist-ai/components/date-picker.md +153 -0
- package/dist-ai/components/descriptions-item.json +175 -0
- package/dist-ai/components/descriptions-item.md +73 -0
- package/dist-ai/components/descriptions.json +171 -0
- package/dist-ai/components/descriptions.md +78 -0
- package/dist-ai/components/dialog.json +403 -0
- package/dist-ai/components/dialog.md +108 -0
- package/dist-ai/components/divider.json +102 -0
- package/dist-ai/components/divider.md +59 -0
- package/dist-ai/components/drawer.json +468 -0
- package/dist-ai/components/drawer.md +115 -0
- package/dist-ai/components/dropdown-item.json +156 -0
- package/dist-ai/components/dropdown-item.md +84 -0
- package/dist-ai/components/dropdown-menu.json +92 -0
- package/dist-ai/components/dropdown-menu.md +70 -0
- package/dist-ai/components/dropdown.json +374 -0
- package/dist-ai/components/dropdown.md +108 -0
- package/dist-ai/components/empty.json +116 -0
- package/dist-ai/components/empty.md +62 -0
- package/dist-ai/components/footer.json +86 -0
- package/dist-ai/components/footer.md +63 -0
- package/dist-ai/components/form-item.json +242 -0
- package/dist-ai/components/form-item.md +93 -0
- package/dist-ai/components/form.json +277 -0
- package/dist-ai/components/form.md +117 -0
- package/dist-ai/components/header.json +86 -0
- package/dist-ai/components/header.md +63 -0
- package/dist-ai/components/icon.json +95 -0
- package/dist-ai/components/icon.md +61 -0
- package/dist-ai/components/image-viewer.json +235 -0
- package/dist-ai/components/image-viewer.md +88 -0
- package/dist-ai/components/image.json +299 -0
- package/dist-ai/components/image.md +96 -0
- package/dist-ai/components/input-number.json +370 -0
- package/dist-ai/components/input-number.md +127 -0
- package/dist-ai/components/input.json +545 -0
- package/dist-ai/components/input.md +166 -0
- package/dist-ai/components/link.json +162 -0
- package/dist-ai/components/link.md +72 -0
- package/dist-ai/components/main.json +77 -0
- package/dist-ai/components/main.md +58 -0
- package/dist-ai/components/mention.json +598 -0
- package/dist-ai/components/mention.md +136 -0
- package/dist-ai/components/menu-item-group.json +101 -0
- package/dist-ai/components/menu-item-group.md +69 -0
- package/dist-ai/components/menu-item.json +131 -0
- package/dist-ai/components/menu-item.md +76 -0
- package/dist-ai/components/menu.json +314 -0
- package/dist-ai/components/menu.md +104 -0
- package/dist-ai/components/option-group.json +113 -0
- package/dist-ai/components/option-group.md +79 -0
- package/dist-ai/components/option.json +122 -0
- package/dist-ai/components/option.md +70 -0
- package/dist-ai/components/page-header.json +131 -0
- package/dist-ai/components/page-header.md +70 -0
- package/dist-ai/components/pagination.json +325 -0
- package/dist-ai/components/pagination.md +115 -0
- package/dist-ai/components/popconfirm.json +240 -0
- package/dist-ai/components/popconfirm.md +89 -0
- package/dist-ai/components/popover.json +351 -0
- package/dist-ai/components/popover.md +99 -0
- package/dist-ai/components/popper.json +93 -0
- package/dist-ai/components/popper.md +66 -0
- package/dist-ai/components/progress.json +219 -0
- package/dist-ai/components/progress.md +74 -0
- package/dist-ai/components/radio-button.json +142 -0
- package/dist-ai/components/radio-button.md +76 -0
- package/dist-ai/components/radio-group.json +219 -0
- package/dist-ai/components/radio-group.md +88 -0
- package/dist-ai/components/radio.json +177 -0
- package/dist-ai/components/radio.md +83 -0
- package/dist-ai/components/rate.json +286 -0
- package/dist-ai/components/rate.md +83 -0
- package/dist-ai/components/result.json +118 -0
- package/dist-ai/components/result.md +66 -0
- package/dist-ai/components/row.json +115 -0
- package/dist-ai/components/row.md +68 -0
- package/dist-ai/components/scrollbar.json +280 -0
- package/dist-ai/components/scrollbar.md +89 -0
- package/dist-ai/components/segmented.json +204 -0
- package/dist-ai/components/segmented.md +81 -0
- package/dist-ai/components/select-v2.json +729 -0
- package/dist-ai/components/select-v2.md +193 -0
- package/dist-ai/components/select.json +697 -0
- package/dist-ai/components/select.md +188 -0
- package/dist-ai/components/skeleton-item.json +80 -0
- package/dist-ai/components/skeleton-item.md +57 -0
- package/dist-ai/components/skeleton.json +134 -0
- package/dist-ai/components/skeleton.md +65 -0
- package/dist-ai/components/slider.json +326 -0
- package/dist-ai/components/slider.md +88 -0
- package/dist-ai/components/space.json +178 -0
- package/dist-ai/components/space.md +73 -0
- package/dist-ai/components/statistic.json +167 -0
- package/dist-ai/components/statistic.md +66 -0
- package/dist-ai/components/step.json +124 -0
- package/dist-ai/components/step.md +69 -0
- package/dist-ai/components/steps.json +157 -0
- package/dist-ai/components/steps.md +79 -0
- package/dist-ai/components/sub-menu.json +211 -0
- package/dist-ai/components/sub-menu.md +88 -0
- package/dist-ai/components/switch.json +292 -0
- package/dist-ai/components/switch.md +88 -0
- package/dist-ai/components/tab-pane.json +137 -0
- package/dist-ai/components/tab-pane.md +72 -0
- package/dist-ai/components/table-column.json +368 -0
- package/dist-ai/components/table-column.md +103 -0
- package/dist-ai/components/table-v2.json +486 -0
- package/dist-ai/components/table-v2.md +123 -0
- package/dist-ai/components/table.json +734 -0
- package/dist-ai/components/table.md +205 -0
- package/dist-ai/components/tabs.json +231 -0
- package/dist-ai/components/tabs.md +127 -0
- package/dist-ai/components/tag.json +205 -0
- package/dist-ai/components/tag.md +105 -0
- package/dist-ai/components/text.json +143 -0
- package/dist-ai/components/text.md +66 -0
- package/dist-ai/components/time-picker.json +555 -0
- package/dist-ai/components/time-picker.md +123 -0
- package/dist-ai/components/time-select.json +321 -0
- package/dist-ai/components/time-select.md +93 -0
- package/dist-ai/components/timeline-item.json +186 -0
- package/dist-ai/components/timeline-item.md +78 -0
- package/dist-ai/components/timeline.json +99 -0
- package/dist-ai/components/timeline.md +65 -0
- package/dist-ai/components/tooltip.json +599 -0
- package/dist-ai/components/tooltip.md +137 -0
- package/dist-ai/components/tour-step.json +219 -0
- package/dist-ai/components/tour-step.md +88 -0
- package/dist-ai/components/tour.json +258 -0
- package/dist-ai/components/tour.md +96 -0
- package/dist-ai/components/transfer.json +275 -0
- package/dist-ai/components/transfer.md +95 -0
- package/dist-ai/components/tree-select.json +945 -0
- package/dist-ai/components/tree-select.md +181 -0
- package/dist-ai/components/tree-v2.json +395 -0
- package/dist-ai/components/tree-v2.md +113 -0
- package/dist-ai/components/tree.json +485 -0
- package/dist-ai/components/tree.md +131 -0
- package/dist-ai/components/upload.json +382 -0
- package/dist-ai/components/upload.md +130 -0
- package/dist-ai/components/watermark.json +157 -0
- package/dist-ai/components/watermark.md +66 -0
- package/dist-ai/directives/click-outside.json +61 -0
- package/dist-ai/directives/click-outside.md +50 -0
- package/dist-ai/directives/infinite-scroll.json +83 -0
- package/dist-ai/directives/infinite-scroll.md +62 -0
- package/dist-ai/directives/loading.json +89 -0
- package/dist-ai/directives/loading.md +69 -0
- package/dist-ai/directives/mousewheel.json +54 -0
- package/dist-ai/directives/mousewheel.md +48 -0
- package/dist-ai/directives/repeat-click.json +68 -0
- package/dist-ai/directives/repeat-click.md +49 -0
- package/dist-ai/directives/trap-focus.json +46 -0
- package/dist-ai/directives/trap-focus.md +46 -0
- package/dist-ai/icons.json +1 -0
- package/dist-ai/index.json +1 -0
- package/dist-ai/llms.txt +170 -0
- package/dist-ai/manifest.json +26590 -0
- package/dist-ai/schema/manifest.schema.json +793 -0
- package/dist-ai/services/infinite-scroll.json +80 -0
- package/dist-ai/services/infinite-scroll.md +71 -0
- package/dist-ai/services/loading.json +108 -0
- package/dist-ai/services/loading.md +58 -0
- package/dist-ai/services/message-box.json +159 -0
- package/dist-ai/services/message-box.md +78 -0
- package/dist-ai/services/message.json +137 -0
- package/dist-ai/services/message.md +72 -0
- package/dist-ai/services/notification.json +136 -0
- package/dist-ai/services/notification.md +73 -0
- package/package.json +12 -2
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# EpTable
|
|
2
|
+
|
|
3
|
+
`ep-table` · data(数据展示) · `component:table`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
数据表格,支持排序、筛选与固定列
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:展示结构化列表数据
|
|
12
|
+
- 适用:排序、筛选与分页浏览
|
|
13
|
+
- 不适用:展示单个对象详情时使用 Descriptions
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:表格、数据表、列表、数据
|
|
18
|
+
- English: table, grid, datatable, data
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- size: large/default/small(按容器空间与信息密度选择尺寸)
|
|
23
|
+
- effect: border(通过视觉修饰属性调整外观效果)
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
- data (any[],默认 []):显示的数据
|
|
28
|
+
- size ('large' | 'default' | 'small'):Table 的尺寸
|
|
29
|
+
- width (unknown)
|
|
30
|
+
- height (string | number):Table 的高度
|
|
31
|
+
- maxHeight (string | number):Table 的最大高度
|
|
32
|
+
- fit (boolean,默认 true):列的宽度是否自撑开
|
|
33
|
+
- stripe (boolean):是否为斑马纹 table
|
|
34
|
+
- border (boolean):是否带有纵向边框
|
|
35
|
+
- rowKey (string | ((row) => string)):行数据的 Key
|
|
36
|
+
- context (unknown)
|
|
37
|
+
- showHeader (boolean,默认 true):是否显示表头
|
|
38
|
+
- showSummary (boolean):是否在表尾显示合计行
|
|
39
|
+
- sumText (string):合计行第一列的文本
|
|
40
|
+
- summaryMethod (({ columns, data }) => string[]):自定义合计计算方法
|
|
41
|
+
- rowClassName (string | ((row, rowIndex) => string)):行的 className 的回调方法
|
|
42
|
+
- rowStyle (object | ((row, rowIndex) => object)):行的 style 的回调方法
|
|
43
|
+
- cellClassName (string | ((row, column, rowIndex, columnIndex) => string)):单元格的 className 的回调方法
|
|
44
|
+
- cellStyle (object | ((row, column, rowIndex, columnIndex) => object)):单元格的 style 的回调方法
|
|
45
|
+
- headerRowClassName (string | ((row, rowIndex) => string)):表头行的 className 的回调
|
|
46
|
+
- headerRowStyle (object | ((row, rowIndex) => object)):表头行的 style 的回调
|
|
47
|
+
- headerCellClassName (unknown)
|
|
48
|
+
- headerCellStyle (unknown)
|
|
49
|
+
- highlightCurrentRow (boolean):是否要高亮当前行
|
|
50
|
+
- currentRowKey (string | number):当前行的 key
|
|
51
|
+
- emptyText (string):空数据时显示的文本内容
|
|
52
|
+
- expandRowKeys (string[]):可以通过该属性设置目前的展开行
|
|
53
|
+
- defaultExpandAll (boolean):是否默认展开所有行
|
|
54
|
+
- rowExpandable (unknown)
|
|
55
|
+
- defaultSort ({ prop: string, order: 'ascending' | 'descending' }):默认的排序列和排序顺序
|
|
56
|
+
- tooltipEffect ('dark' | 'light'):tooltip 效果
|
|
57
|
+
- tooltipOptions (unknown)
|
|
58
|
+
- spanMethod (({ row, column, rowIndex, columnIndex }) => number[] | { rowspan: number, colspan: number }):合并行或列的计算方法
|
|
59
|
+
- selectOnIndeterminate (boolean,默认 true):全选勾选是否选择所有数据
|
|
60
|
+
- indent (number,默认 16):展示树形数据时缩进的大小
|
|
61
|
+
- treeProps ({ hasChildren: string, children: string },默认 { hasChildren: 'hasChildren', children: 'children' }):渲染嵌套数据的配置选项
|
|
62
|
+
- lazy (boolean):是否懒加载子节点数据
|
|
63
|
+
- load ((row, treeNode, resolve) => void):加载子节点数据的函数
|
|
64
|
+
- className (unknown,默认 见文档)
|
|
65
|
+
- style (unknown,默认 见文档)
|
|
66
|
+
- tableLayout ('fixed' | 'auto',默认 fixed):表格布局方式
|
|
67
|
+
- scrollbarAlwaysOn (boolean):是否总是显示滚动条
|
|
68
|
+
- flexible (boolean):确保主轴的最小尺寸
|
|
69
|
+
- showOverflowTooltip (unknown,默认 见文档)
|
|
70
|
+
- tooltipFormatter (unknown)
|
|
71
|
+
- appendFilterPanelTo (unknown)
|
|
72
|
+
- scrollbarTabindex (unknown,默认 见文档)
|
|
73
|
+
- allowDragLastColumn (unknown,默认 见文档)
|
|
74
|
+
- preserveExpandedContent (unknown)
|
|
75
|
+
- nativeScrollbar (unknown)
|
|
76
|
+
|
|
77
|
+
## Events
|
|
78
|
+
|
|
79
|
+
- select((selection, row)):当用户手动勾选数据行的 Checkbox 时触发
|
|
80
|
+
- selectAll((selection)):当用户手动勾选全选 Checkbox 时触发
|
|
81
|
+
- selectionChange((selection)):当选择项发生变化时触发
|
|
82
|
+
- cellMouseEnter((row, column, cell, event)):当单元格 hover 进入时触发
|
|
83
|
+
- cellMouseLeave((row, column, cell, event)):当单元格 hover 退出时触发
|
|
84
|
+
- cellDblclick((row, column, cell, event)):当某个单元格被双击击时触发
|
|
85
|
+
- cellContextmenu((row, column, cell, event)):当某个单元格被鼠标右键点击时触发
|
|
86
|
+
- cellClick((row, column, cell, event)):当某个单元格被点击时触发
|
|
87
|
+
- rowDblclick((row, column, event)):当某一行被双击时触发
|
|
88
|
+
- rowClick((row, column, event)):当某一行被点击时触发
|
|
89
|
+
- rowContextmenu((row, column, event)):当某一行被鼠标右键点击时触发
|
|
90
|
+
- headerClick((column, event)):当某一列的表头被点击时触发
|
|
91
|
+
- headerContextmenu((column, event)):当某一列的表头被鼠标右键点击时触发
|
|
92
|
+
- sortChange(({ column, prop, order })):当表格的排序条件发生变化时触发
|
|
93
|
+
- filterChange((filters)):当表格的筛选条件发生变化时触发
|
|
94
|
+
- currentChange((currentRow, oldCurrentRow)):当表格的当前行发生变化时触发
|
|
95
|
+
- headerDragend((newWidth: number, oldWidth: number, column: TableColumnCtx, event: MouseEvent)):拖动列宽结束后触发
|
|
96
|
+
- expandChange((row, expandedRows | expanded)):当用户对某一行展开或关闭时触发
|
|
97
|
+
- scroll(({ scrollLeft, scrollTop }: { scrollLeft: number; scrollTop: number })):表格滚动时触发
|
|
98
|
+
|
|
99
|
+
## Slots
|
|
100
|
+
|
|
101
|
+
- default:自定义默认内容
|
|
102
|
+
- append:插入至表格最后一行之后的内容
|
|
103
|
+
- empty:当数据为空时自定义的内容
|
|
104
|
+
|
|
105
|
+
## Exposes
|
|
106
|
+
|
|
107
|
+
- clearSelection(() => void):清空用户的选择
|
|
108
|
+
- getSelectionRows(() => any[]):返回当前选中的行
|
|
109
|
+
- getHalfSelectionRows(() => any[]):返回当前半选的行
|
|
110
|
+
- toggleRowSelection((row: any, selected?: boolean) => void):切换某一行的选中状态
|
|
111
|
+
- toggleAllSelection(() => void):切换所有行的选中状态
|
|
112
|
+
- toggleRowExpansion((row: any, expanded?: boolean) => void):切换某一行的展开状态
|
|
113
|
+
- setCurrentRow((row: any) => void):设置某一行为选中行
|
|
114
|
+
- clearSort(() => void):清空排序条件
|
|
115
|
+
- clearFilter((columnKeys?: string[]) => void):清空过滤条件
|
|
116
|
+
- doLayout(() => void):对 Table 进行重新布局
|
|
117
|
+
- sort((prop: string, order: string) => void):手动对 Table 进行排序
|
|
118
|
+
- updateKeyChildren((key: string, data: any[]) => void):懒加载表格中,更新某一行的子节点数据(需设置 row-key)
|
|
119
|
+
- scrollTo((options: ScrollToOptions | number, yCoord?: number) => void):滚动到一组特定坐标
|
|
120
|
+
- setScrollTop((top: number) => void):设置垂直滚动位置
|
|
121
|
+
- setScrollLeft((left: number) => void):设置水平滚动位置
|
|
122
|
+
|
|
123
|
+
## 关系
|
|
124
|
+
|
|
125
|
+
- 子级:EpTableColumn
|
|
126
|
+
- 常用组合:EpTable + EpTableColumn
|
|
127
|
+
|
|
128
|
+
## 视觉提示
|
|
129
|
+
|
|
130
|
+
- 形状:块级数据区域
|
|
131
|
+
- 密度:紧凑
|
|
132
|
+
- 插槽内容:default:自定义默认内容;append:插入至表格最后一行之后的内容;empty:当数据为空时自定义的内容
|
|
133
|
+
- CSS 变量:--el-border-color-lighter、--el-bg-color、--el-text-color-regular、--el-font-size-base
|
|
134
|
+
|
|
135
|
+
## 示例
|
|
136
|
+
|
|
137
|
+
### 基础表格
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<script setup lang="ts">
|
|
141
|
+
import { EpTable, EpTableColumn } from 'ep-craft'
|
|
142
|
+
|
|
143
|
+
const rows = [
|
|
144
|
+
{ date: '2026-01-01', name: '张三', address: '杭州市西湖区' },
|
|
145
|
+
{ date: '2026-01-02', name: '李四', address: '上海市浦东新区' },
|
|
146
|
+
]
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<template>
|
|
150
|
+
<ep-table :data="rows">
|
|
151
|
+
<ep-table-column prop="date" label="日期" width="160" />
|
|
152
|
+
<ep-table-column prop="name" label="姓名" width="120" />
|
|
153
|
+
<ep-table-column prop="address" label="地址" />
|
|
154
|
+
</ep-table>
|
|
155
|
+
</template>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 斑马纹与边框
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<script setup lang="ts">
|
|
162
|
+
import { EpTable, EpTableColumn } from 'ep-craft'
|
|
163
|
+
|
|
164
|
+
const rows = [
|
|
165
|
+
{ date: '2026-01-01', name: '张三' },
|
|
166
|
+
{ date: '2026-01-02', name: '李四' },
|
|
167
|
+
]
|
|
168
|
+
</script>
|
|
169
|
+
|
|
170
|
+
<template>
|
|
171
|
+
<ep-table :data="rows" stripe border>
|
|
172
|
+
<ep-table-column prop="date" label="日期" />
|
|
173
|
+
<ep-table-column prop="name" label="姓名" />
|
|
174
|
+
</ep-table>
|
|
175
|
+
</template>
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 固定列
|
|
179
|
+
|
|
180
|
+
```vue
|
|
181
|
+
<script setup lang="ts">
|
|
182
|
+
import { EpTable, EpTableColumn } from 'ep-craft'
|
|
183
|
+
|
|
184
|
+
const rows = [
|
|
185
|
+
{ id: '1001', name: '张三', address: '杭州市西湖区文三路 20 号' },
|
|
186
|
+
{ id: '1002', name: '李四', address: '上海市浦东新区世纪大道 100 号' },
|
|
187
|
+
]
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
<template>
|
|
191
|
+
<ep-table :data="rows" style="width: 100%">
|
|
192
|
+
<ep-table-column prop="id" label="编号" width="120" fixed="left" />
|
|
193
|
+
<ep-table-column prop="name" label="姓名" width="120" />
|
|
194
|
+
<ep-table-column prop="address" label="地址" width="360" />
|
|
195
|
+
</ep-table>
|
|
196
|
+
</template>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## 相关条目
|
|
200
|
+
|
|
201
|
+
- EpTableColumn
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "navigation",
|
|
4
|
+
"events": [
|
|
5
|
+
{
|
|
6
|
+
"description": "选中选项卡的绑定值变化时触发",
|
|
7
|
+
"name": "update:modelValue",
|
|
8
|
+
"params": "(name: string | number)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"description": "tab 被选中时触发",
|
|
12
|
+
"name": "tabClick",
|
|
13
|
+
"params": "(pane: TabsPaneContext, ev: Event)"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "activeName 改变时触发",
|
|
17
|
+
"name": "tabChange",
|
|
18
|
+
"params": "(name: string | number)"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"description": "点击 tab 的新增或移除按钮时触发",
|
|
22
|
+
"name": "edit",
|
|
23
|
+
"params": "(paneName: string | number | undefined, action: 'remove' | 'add')"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"description": "点击 tab 移除按钮时触发",
|
|
27
|
+
"name": "tabRemove",
|
|
28
|
+
"params": "(name: string | number)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "点击 tab 新增按钮时触发",
|
|
32
|
+
"name": "tabAdd",
|
|
33
|
+
"params": "—"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"exampleOmittedReason": null,
|
|
37
|
+
"examples": [
|
|
38
|
+
{
|
|
39
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpTabPane, EpTabs } from 'ep-craft'\n\nconst active = ref('first')\n</script>\n\n<template>\n <ep-tabs v-model=\"active\">\n <ep-tab-pane label=\"用户\" name=\"first\">用户管理</ep-tab-pane>\n <ep-tab-pane label=\"配置\" name=\"second\">系统配置</ep-tab-pane>\n </ep-tabs>\n</template>",
|
|
40
|
+
"id": "tabs-1",
|
|
41
|
+
"language": "vue",
|
|
42
|
+
"title": "基础标签页"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpTabPane, EpTabs } from 'ep-craft'\n\nconst active = ref('first')\n</script>\n\n<template>\n <ep-tabs v-model=\"active\" type=\"card\">\n <ep-tab-pane label=\"概览\" name=\"first\">概览内容</ep-tab-pane>\n <ep-tab-pane label=\"详情\" name=\"second\">详情内容</ep-tab-pane>\n </ep-tabs>\n</template>",
|
|
46
|
+
"id": "tabs-2",
|
|
47
|
+
"language": "vue",
|
|
48
|
+
"title": "卡片样式"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpTabPane, EpTabs } from 'ep-craft'\n\nconst active = ref('first')\n</script>\n\n<template>\n <ep-tabs v-model=\"active\" tab-position=\"left\" style=\"height: 160px\">\n <ep-tab-pane label=\"基础\" name=\"first\">基础设置</ep-tab-pane>\n <ep-tab-pane label=\"高级\" name=\"second\">高级设置</ep-tab-pane>\n </ep-tabs>\n</template>",
|
|
52
|
+
"id": "tabs-3",
|
|
53
|
+
"language": "vue",
|
|
54
|
+
"title": "左侧标签"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"exposes": [],
|
|
58
|
+
"hot": true,
|
|
59
|
+
"id": "component:tabs",
|
|
60
|
+
"keywords": {
|
|
61
|
+
"en": [
|
|
62
|
+
"tabs",
|
|
63
|
+
"tab",
|
|
64
|
+
"tabbed",
|
|
65
|
+
"navigation"
|
|
66
|
+
],
|
|
67
|
+
"zh": [
|
|
68
|
+
"标签页",
|
|
69
|
+
"选项卡",
|
|
70
|
+
"切换",
|
|
71
|
+
"导航"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"kind": "component",
|
|
75
|
+
"name": "EpTabs",
|
|
76
|
+
"nonUseCases": [
|
|
77
|
+
"单步无层级的简单跳转时"
|
|
78
|
+
],
|
|
79
|
+
"props": [
|
|
80
|
+
{
|
|
81
|
+
"alias": null,
|
|
82
|
+
"defaultText": null,
|
|
83
|
+
"description": "风格类型",
|
|
84
|
+
"hasDefault": true,
|
|
85
|
+
"name": "type",
|
|
86
|
+
"required": false,
|
|
87
|
+
"type": "'card' | 'border-card' | ''"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"alias": null,
|
|
91
|
+
"defaultText": "false",
|
|
92
|
+
"description": "标签是否可关闭",
|
|
93
|
+
"hasDefault": false,
|
|
94
|
+
"name": "closable",
|
|
95
|
+
"required": false,
|
|
96
|
+
"type": "boolean"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"alias": null,
|
|
100
|
+
"defaultText": "false",
|
|
101
|
+
"description": "标签是否可增加",
|
|
102
|
+
"hasDefault": false,
|
|
103
|
+
"name": "addable",
|
|
104
|
+
"required": false,
|
|
105
|
+
"type": "boolean"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"alias": "v-model",
|
|
109
|
+
"defaultText": null,
|
|
110
|
+
"description": "绑定值,选中选项卡的 name",
|
|
111
|
+
"hasDefault": false,
|
|
112
|
+
"name": "modelValue",
|
|
113
|
+
"required": false,
|
|
114
|
+
"type": "string | number"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"alias": null,
|
|
118
|
+
"defaultText": null,
|
|
119
|
+
"description": "",
|
|
120
|
+
"hasDefault": false,
|
|
121
|
+
"name": "defaultValue",
|
|
122
|
+
"required": false,
|
|
123
|
+
"type": "unknown"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"alias": null,
|
|
127
|
+
"defaultText": "false",
|
|
128
|
+
"description": "标签是否同时可增加和关闭",
|
|
129
|
+
"hasDefault": false,
|
|
130
|
+
"name": "editable",
|
|
131
|
+
"required": false,
|
|
132
|
+
"type": "boolean"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"alias": null,
|
|
136
|
+
"defaultText": "top",
|
|
137
|
+
"description": "选项卡所在位置",
|
|
138
|
+
"hasDefault": true,
|
|
139
|
+
"name": "tabPosition",
|
|
140
|
+
"required": false,
|
|
141
|
+
"type": "'top' | 'right' | 'bottom' | 'left'"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"alias": null,
|
|
145
|
+
"defaultText": null,
|
|
146
|
+
"description": "切换标签之前的钩子,返回 false 或 reject 则阻止切换",
|
|
147
|
+
"hasDefault": true,
|
|
148
|
+
"name": "beforeLeave",
|
|
149
|
+
"required": false,
|
|
150
|
+
"type": "(activeName, oldActiveName) => boolean | Promise<void>"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"alias": null,
|
|
154
|
+
"defaultText": "false",
|
|
155
|
+
"description": "标签的宽度是否自撑开",
|
|
156
|
+
"hasDefault": false,
|
|
157
|
+
"name": "stretch",
|
|
158
|
+
"required": false,
|
|
159
|
+
"type": "boolean"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"alias": null,
|
|
163
|
+
"defaultText": null,
|
|
164
|
+
"description": "",
|
|
165
|
+
"hasDefault": true,
|
|
166
|
+
"name": "tabindex",
|
|
167
|
+
"required": false,
|
|
168
|
+
"type": "unknown"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"related": [
|
|
172
|
+
"EpTabPane",
|
|
173
|
+
"EpMenu"
|
|
174
|
+
],
|
|
175
|
+
"relations": {
|
|
176
|
+
"children": [
|
|
177
|
+
"EpTabPane"
|
|
178
|
+
],
|
|
179
|
+
"combos": [
|
|
180
|
+
"EpTabs + EpTabPane"
|
|
181
|
+
],
|
|
182
|
+
"parents": [],
|
|
183
|
+
"requiredChildren": [
|
|
184
|
+
"EpTabPane"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"slots": [
|
|
188
|
+
{
|
|
189
|
+
"description": "默认插槽,放置 ep-tab-pane",
|
|
190
|
+
"name": "default"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"description": "自定义新增按钮图标",
|
|
194
|
+
"name": "add-icon"
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"slug": "tabs",
|
|
198
|
+
"summary": "标签页,切换同区域内的多组内容",
|
|
199
|
+
"tag": "ep-tabs",
|
|
200
|
+
"useCases": [
|
|
201
|
+
"同区域多视图切换",
|
|
202
|
+
"设置页与详情页的内容分组"
|
|
203
|
+
],
|
|
204
|
+
"variants": [
|
|
205
|
+
{
|
|
206
|
+
"dimension": "type",
|
|
207
|
+
"values": [
|
|
208
|
+
"card",
|
|
209
|
+
"border-card"
|
|
210
|
+
],
|
|
211
|
+
"when": "通过 type 选择风格类型"
|
|
212
|
+
}
|
|
213
|
+
],
|
|
214
|
+
"visual": {
|
|
215
|
+
"cssVars": [
|
|
216
|
+
"--el-color-primary",
|
|
217
|
+
"--el-text-color-regular",
|
|
218
|
+
"--el-bg-color"
|
|
219
|
+
],
|
|
220
|
+
"density": "中等",
|
|
221
|
+
"shape": "条状或列表",
|
|
222
|
+
"slotContent": [
|
|
223
|
+
"default:默认插槽,放置 ep-tab-pane",
|
|
224
|
+
"add-icon:自定义新增按钮图标"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
229
|
+
"libraryVersion": "0.2.0",
|
|
230
|
+
"schemaVersion": 1
|
|
231
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# EpTabs
|
|
2
|
+
|
|
3
|
+
`ep-tabs` · navigation(导航) · `component:tabs`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
标签页,切换同区域内的多组内容
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:同区域多视图切换
|
|
12
|
+
- 适用:设置页与详情页的内容分组
|
|
13
|
+
- 不适用:单步无层级的简单跳转时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:标签页、选项卡、切换、导航
|
|
18
|
+
- English: tabs, tab, tabbed, navigation
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- type: card/border-card(通过 type 选择风格类型)
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
- type ('card' | 'border-card' | '',默认 见文档):风格类型
|
|
27
|
+
- closable (boolean):标签是否可关闭
|
|
28
|
+
- addable (boolean):标签是否可增加
|
|
29
|
+
- modelValue(别名 v-model) (string | number):绑定值,选中选项卡的 name
|
|
30
|
+
- defaultValue (unknown)
|
|
31
|
+
- editable (boolean):标签是否同时可增加和关闭
|
|
32
|
+
- tabPosition ('top' | 'right' | 'bottom' | 'left',默认 top):选项卡所在位置
|
|
33
|
+
- beforeLeave ((activeName, oldActiveName) => boolean | Promise<void>,默认 见文档):切换标签之前的钩子,返回 false 或 reject 则阻止切换
|
|
34
|
+
- stretch (boolean):标签的宽度是否自撑开
|
|
35
|
+
- tabindex (unknown,默认 见文档)
|
|
36
|
+
|
|
37
|
+
## Events
|
|
38
|
+
|
|
39
|
+
- update:modelValue((name: string | number)):选中选项卡的绑定值变化时触发
|
|
40
|
+
- tabClick((pane: TabsPaneContext, ev: Event)):tab 被选中时触发
|
|
41
|
+
- tabChange((name: string | number)):activeName 改变时触发
|
|
42
|
+
- edit((paneName: string | number | undefined, action: 'remove' | 'add')):点击 tab 的新增或移除按钮时触发
|
|
43
|
+
- tabRemove((name: string | number)):点击 tab 移除按钮时触发
|
|
44
|
+
- tabAdd(—):点击 tab 新增按钮时触发
|
|
45
|
+
|
|
46
|
+
## Slots
|
|
47
|
+
|
|
48
|
+
- default:默认插槽,放置 ep-tab-pane
|
|
49
|
+
- add-icon:自定义新增按钮图标
|
|
50
|
+
|
|
51
|
+
## 关系
|
|
52
|
+
|
|
53
|
+
- 子级:EpTabPane
|
|
54
|
+
- 必需子组件:EpTabPane
|
|
55
|
+
- 常用组合:EpTabs + EpTabPane
|
|
56
|
+
|
|
57
|
+
## 视觉提示
|
|
58
|
+
|
|
59
|
+
- 形状:条状或列表
|
|
60
|
+
- 密度:中等
|
|
61
|
+
- 插槽内容:default:默认插槽,放置 ep-tab-pane;add-icon:自定义新增按钮图标
|
|
62
|
+
- CSS 变量:--el-color-primary、--el-text-color-regular、--el-bg-color
|
|
63
|
+
|
|
64
|
+
## 示例
|
|
65
|
+
|
|
66
|
+
### 基础标签页
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
import { ref } from 'vue'
|
|
71
|
+
import { EpTabPane, EpTabs } from 'ep-craft'
|
|
72
|
+
|
|
73
|
+
const active = ref('first')
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<ep-tabs v-model="active">
|
|
78
|
+
<ep-tab-pane label="用户" name="first">用户管理</ep-tab-pane>
|
|
79
|
+
<ep-tab-pane label="配置" name="second">系统配置</ep-tab-pane>
|
|
80
|
+
</ep-tabs>
|
|
81
|
+
</template>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 卡片样式
|
|
85
|
+
|
|
86
|
+
```vue
|
|
87
|
+
<script setup lang="ts">
|
|
88
|
+
import { ref } from 'vue'
|
|
89
|
+
import { EpTabPane, EpTabs } from 'ep-craft'
|
|
90
|
+
|
|
91
|
+
const active = ref('first')
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<ep-tabs v-model="active" type="card">
|
|
96
|
+
<ep-tab-pane label="概览" name="first">概览内容</ep-tab-pane>
|
|
97
|
+
<ep-tab-pane label="详情" name="second">详情内容</ep-tab-pane>
|
|
98
|
+
</ep-tabs>
|
|
99
|
+
</template>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 左侧标签
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<script setup lang="ts">
|
|
106
|
+
import { ref } from 'vue'
|
|
107
|
+
import { EpTabPane, EpTabs } from 'ep-craft'
|
|
108
|
+
|
|
109
|
+
const active = ref('first')
|
|
110
|
+
</script>
|
|
111
|
+
|
|
112
|
+
<template>
|
|
113
|
+
<ep-tabs v-model="active" tab-position="left" style="height: 160px">
|
|
114
|
+
<ep-tab-pane label="基础" name="first">基础设置</ep-tab-pane>
|
|
115
|
+
<ep-tab-pane label="高级" name="second">高级设置</ep-tab-pane>
|
|
116
|
+
</ep-tabs>
|
|
117
|
+
</template>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 相关条目
|
|
121
|
+
|
|
122
|
+
- EpTabPane
|
|
123
|
+
- EpMenu
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
ep-craft 0.2.0
|