ep-craft 0.1.41 → 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/components/input-number/EpInputNumber.vue.js +62 -63
- package/dist/components/input-number/input-number.d.ts +5 -0
- package/dist/components/input-number/input-number.js +6 -6
- package/dist/components/select/index.d.ts +6 -3
- package/dist/components/select/select.d.ts +1 -0
- package/dist/components/select/select.js +3 -3
- package/dist/components/select/select.vue.d.ts +3 -1
- package/dist/components/select/select.vue.js +9 -9
- package/dist/components/select/select2.vue.js +73 -75
- package/dist/components/select-v2/src/defaults.d.ts +1 -0
- package/dist/components/select-v2/src/defaults.js +1 -1
- package/dist/components/select-v2/src/select.vue.d.ts +3 -1
- package/dist/components/select-v2/src/select.vue.js +21 -21
- package/dist/components/select-v2/src/select2.vue.js +27 -29
- package/dist/components/tree-select/src/tree-select.vue.d.ts +2 -0
- 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,181 @@
|
|
|
1
|
+
# EpTreeSelect
|
|
2
|
+
|
|
3
|
+
`ep-tree-select` · data(数据展示) · `component:tree-select`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
树形选择,结构化数据展示
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:展示树形选择类结构化数据
|
|
12
|
+
- 适用:需要浏览、比较或定位数据时
|
|
13
|
+
- 不适用:数据量极小且无需结构化展示时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:树形选择、数据
|
|
18
|
+
- English: tree-select, tree, select, data
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- size: large/default/small(按容器空间与信息密度选择尺寸)
|
|
23
|
+
- state: disabled(通过布尔属性切换禁用、加载或选中状态)
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
- name (unknown)
|
|
28
|
+
- id (unknown)
|
|
29
|
+
- modelValue(别名 v-model) (TreeKey | TreeKey[],默认 见文档):绑定值,多选时为数组
|
|
30
|
+
- autocomplete (unknown,默认 见文档)
|
|
31
|
+
- automaticDropdown (unknown)
|
|
32
|
+
- size ('large' | 'default' | 'small'):尺寸
|
|
33
|
+
- effect (unknown,默认 见文档)
|
|
34
|
+
- disabled (boolean,默认 见文档):是否禁用
|
|
35
|
+
- clearable (boolean):是否可清空
|
|
36
|
+
- filterable (boolean):是否可搜索
|
|
37
|
+
- allowCreate (unknown)
|
|
38
|
+
- loading (unknown)
|
|
39
|
+
- popperClass (string,默认 见文档):下拉框自定义类名
|
|
40
|
+
- popperStyle (unknown)
|
|
41
|
+
- popperOptions (unknown,默认 见文档)
|
|
42
|
+
- remote (unknown)
|
|
43
|
+
- debounce (unknown,默认 见文档)
|
|
44
|
+
- loadingText (unknown)
|
|
45
|
+
- noMatchText (unknown)
|
|
46
|
+
- noDataText (unknown)
|
|
47
|
+
- remoteMethod (unknown)
|
|
48
|
+
- filterMethod (unknown)
|
|
49
|
+
- multiple (boolean):是否多选
|
|
50
|
+
- multipleLimit (unknown,默认 见文档)
|
|
51
|
+
- placeholder (string):占位符
|
|
52
|
+
- defaultFirstOption (unknown)
|
|
53
|
+
- reserveKeyword (unknown,默认 见文档)
|
|
54
|
+
- valueKey (string,默认 value):选项对象中作为 value 的键名
|
|
55
|
+
- collapseTags (boolean):多选时是否折叠标签
|
|
56
|
+
- collapseTagsTooltip (boolean):折叠标签悬停时是否展示全部标签
|
|
57
|
+
- tagTooltip (unknown,默认 见文档)
|
|
58
|
+
- maxCollapseTags (unknown,默认 见文档)
|
|
59
|
+
- teleported (boolean,默认 见文档):是否将下拉框 teleport 到 body
|
|
60
|
+
- persistent (unknown,默认 见文档)
|
|
61
|
+
- clearIcon (unknown,默认 见文档)
|
|
62
|
+
- fitInputWidth (unknown)
|
|
63
|
+
- suffixIcon (unknown,默认 见文档)
|
|
64
|
+
- tagType (unknown,默认 见文档)
|
|
65
|
+
- tagEffect (unknown,默认 见文档)
|
|
66
|
+
- validateEvent (boolean,默认 true):是否触发表单校验
|
|
67
|
+
- remoteShowSuffix (unknown)
|
|
68
|
+
- showArrow (unknown,默认 见文档)
|
|
69
|
+
- offset (unknown,默认 见文档)
|
|
70
|
+
- placement (unknown,默认 见文档)
|
|
71
|
+
- fallbackPlacements (unknown,默认 见文档)
|
|
72
|
+
- tabindex (unknown,默认 见文档)
|
|
73
|
+
- appendTo (unknown)
|
|
74
|
+
- options (unknown)
|
|
75
|
+
- props ({ children?: string; label?: string; disabled?: string },默认 { children: 'children', label: 'label', disabled: 'disabled' }):树节点字段映射
|
|
76
|
+
- floatLabel (unknown,默认 见文档)
|
|
77
|
+
- emptyValues (unknown)
|
|
78
|
+
- valueOnClear (unknown,默认 见文档)
|
|
79
|
+
- ariaLabel (unknown)
|
|
80
|
+
- ariaLabelledby (unknown)
|
|
81
|
+
- data (TreeData,默认 []):树数据
|
|
82
|
+
- emptyText (unknown)
|
|
83
|
+
- renderAfterExpand (boolean,默认 true):是否在第一次展开时才渲染子节点
|
|
84
|
+
- nodeKey (string):树节点唯一标识的属性名
|
|
85
|
+
- checkStrictly (boolean):勾选时是否不关联父子节点
|
|
86
|
+
- defaultExpandAll (boolean):是否默认展开所有节点
|
|
87
|
+
- expandOnClickNode (boolean,默认 true):点击节点时是否展开/收起
|
|
88
|
+
- checkOnClickNode (boolean):点击节点时是否勾选/取消勾选
|
|
89
|
+
- checkOnClickLeaf (boolean,默认 true):点击叶子节点时是否勾选
|
|
90
|
+
- checkDescendants (boolean):勾选时是否影响后代节点
|
|
91
|
+
- autoExpandParent (boolean,默认 true):是否自动展开父节点
|
|
92
|
+
- defaultCheckedKeys (TreeKey[]):默认勾选的节点 key 数组
|
|
93
|
+
- defaultExpandedKeys (TreeKey[]):默认展开的节点 key 数组
|
|
94
|
+
- currentNodeKey (unknown)
|
|
95
|
+
- renderContent (unknown)
|
|
96
|
+
- showCheckbox (boolean):是否显示复选框
|
|
97
|
+
- draggable (unknown)
|
|
98
|
+
- allowDrag (unknown)
|
|
99
|
+
- allowDrop (unknown)
|
|
100
|
+
- lazy (boolean):是否懒加载子节点,需配合 load 使用
|
|
101
|
+
- highlightCurrent (boolean):是否高亮当前选中节点
|
|
102
|
+
- load ((node, resolve, reject) => void):加载子节点的方法
|
|
103
|
+
- filterNodeMethod ((value, data, node) => boolean):过滤树节点的函数
|
|
104
|
+
- accordion (unknown)
|
|
105
|
+
- indent (unknown,默认 见文档)
|
|
106
|
+
- icon (unknown)
|
|
107
|
+
- cacheData (TreeData,默认 []):懒加载节点缓存数据,结构与 data 相同
|
|
108
|
+
|
|
109
|
+
## Events
|
|
110
|
+
|
|
111
|
+
- update:modelValue((value: TreeKey | TreeKey[])):绑定值变化时触发
|
|
112
|
+
- change((value: TreeKey | TreeKey[])):选中值变化时触发
|
|
113
|
+
- visibleChange((visible: boolean)):下拉框显示/隐藏时触发
|
|
114
|
+
- removeTag((value: TreeKey)):移除标签时触发
|
|
115
|
+
- clear(—):清空时触发
|
|
116
|
+
- check((data, checkedInfo: CheckedInfo)):勾选节点时触发
|
|
117
|
+
- nodeClick((data, node, nodeInstance, evt: MouseEvent)):点击节点时触发
|
|
118
|
+
|
|
119
|
+
## Slots
|
|
120
|
+
|
|
121
|
+
- default:自定义树节点内容,参数为 `{ node, data, store }`
|
|
122
|
+
- empty:无数据时的内容
|
|
123
|
+
- prefix:输入框前缀内容
|
|
124
|
+
|
|
125
|
+
## Exposes
|
|
126
|
+
|
|
127
|
+
- focus(() => void):使输入框聚焦
|
|
128
|
+
- blur(() => void):使输入框失焦
|
|
129
|
+
- selectedLabel(ComputedRef<string>):当前选中项的展示文本
|
|
130
|
+
- filter((value: any) => void):过滤树节点
|
|
131
|
+
- getCheckedNodes((leafOnly?: boolean) => Node[]):获取勾选节点
|
|
132
|
+
- setCheckedNodes((nodes: Node[]) => void):设置勾选节点
|
|
133
|
+
- getCheckedKeys((leafOnly?: boolean) => TreeKey[]):获取勾选节点的 key
|
|
134
|
+
- setCheckedKeys((keys: TreeKey[]) => void):设置勾选节点的 key
|
|
135
|
+
- getCurrentKey(() => TreeKey | undefined):获取当前节点的 key
|
|
136
|
+
- getCurrentNode(() => Node | undefined):获取当前节点
|
|
137
|
+
- setCurrentKey((key: TreeKey) => void):设置当前节点的 key
|
|
138
|
+
- setCurrentNode((node: Node) => void):设置当前节点
|
|
139
|
+
- getNode((data: TreeKey | TreeNodeData) => Node):根据 key 或 data 获取节点
|
|
140
|
+
- treeRef(TreeInstance | undefined):内部 ep-tree 实例
|
|
141
|
+
- selectRef(SelectInstance | undefined):内部 ep-select 实例
|
|
142
|
+
|
|
143
|
+
## 视觉提示
|
|
144
|
+
|
|
145
|
+
- 形状:块级数据区域
|
|
146
|
+
- 密度:紧凑
|
|
147
|
+
- 插槽内容:default:自定义树节点内容,参数为 `{ node, data, store }`;empty:无数据时的内容;prefix:输入框前缀内容
|
|
148
|
+
- CSS 变量:--el-border-color-lighter、--el-bg-color、--el-text-color-regular、--el-font-size-base
|
|
149
|
+
|
|
150
|
+
## 示例
|
|
151
|
+
|
|
152
|
+
### 树形选择
|
|
153
|
+
|
|
154
|
+
```vue
|
|
155
|
+
<script setup lang="ts">
|
|
156
|
+
import { ref } from 'vue'
|
|
157
|
+
import { EpTreeSelect } from 'ep-craft'
|
|
158
|
+
|
|
159
|
+
const value = ref('child-1')
|
|
160
|
+
const data = [
|
|
161
|
+
{
|
|
162
|
+
value: 'root',
|
|
163
|
+
label: '根节点',
|
|
164
|
+
children: [{ value: 'child-1', label: '子节点一' }],
|
|
165
|
+
},
|
|
166
|
+
]
|
|
167
|
+
</script>
|
|
168
|
+
|
|
169
|
+
<template>
|
|
170
|
+
<ep-tree-select v-model="value" :data="data" placeholder="请选择节点" />
|
|
171
|
+
</template>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 相关条目
|
|
175
|
+
|
|
176
|
+
- EpSelect
|
|
177
|
+
- EpTree
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "data",
|
|
4
|
+
"events": [
|
|
5
|
+
{
|
|
6
|
+
"description": "点击节点时触发",
|
|
7
|
+
"name": "nodeClick",
|
|
8
|
+
"params": "(data: TreeNodeData, node: TreeNode, e: MouseEvent)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"description": "拖拽放置后触发",
|
|
12
|
+
"name": "nodeDrop",
|
|
13
|
+
"params": "(data: TreeNodeData, node: TreeNode, e: DragEvent)"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "节点展开时触发",
|
|
17
|
+
"name": "nodeExpand",
|
|
18
|
+
"params": "(data: TreeNodeData, node: TreeNode)"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"description": "节点收起时触发",
|
|
22
|
+
"name": "nodeCollapse",
|
|
23
|
+
"params": "(data: TreeNodeData, node: TreeNode)"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"description": "当前节点变化时触发",
|
|
27
|
+
"name": "currentChange",
|
|
28
|
+
"params": "(data: TreeNodeData, node: TreeNode)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"description": "勾选节点时触发",
|
|
32
|
+
"name": "check",
|
|
33
|
+
"params": "(data: TreeNodeData, checkedInfo: CheckedInfo)"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"description": "节点勾选状态变化时触发",
|
|
37
|
+
"name": "checkChange",
|
|
38
|
+
"params": "(data: TreeNodeData, checked: boolean)"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"description": "右键节点时触发",
|
|
42
|
+
"name": "nodeContextmenu",
|
|
43
|
+
"params": "(evt: Event, data: TreeNodeData, node: TreeNode)"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"exampleOmittedReason": null,
|
|
47
|
+
"examples": [
|
|
48
|
+
{
|
|
49
|
+
"code": "<script setup lang=\"ts\">\nimport { EpTreeV2 } from 'ep-craft'\n\nconst data = Array.from({ length: 50 }, (_, index) => ({\n id: index,\n label: `节点 ${index + 1}`,\n}))\n</script>\n\n<template>\n <ep-tree-v2 :data=\"data\" :height=\"240\" />\n</template>",
|
|
50
|
+
"id": "tree-v2-1",
|
|
51
|
+
"language": "vue",
|
|
52
|
+
"title": "虚拟化树"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"exposes": [
|
|
56
|
+
{
|
|
57
|
+
"description": "过滤节点",
|
|
58
|
+
"name": "filter",
|
|
59
|
+
"type": "(value: any) => void"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"description": "获取勾选节点",
|
|
63
|
+
"name": "getCheckedNodes",
|
|
64
|
+
"type": "(leafOnly?: boolean) => TreeNode[]"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"description": "获取勾选节点的 key",
|
|
68
|
+
"name": "getCheckedKeys",
|
|
69
|
+
"type": "(leafOnly?: boolean) => TreeKey[]"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"description": "设置节点勾选状态",
|
|
73
|
+
"name": "setChecked",
|
|
74
|
+
"type": "(key: TreeKey, checked: boolean, deep: boolean) => void"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"description": "设置勾选节点的 key",
|
|
78
|
+
"name": "setCheckedKeys",
|
|
79
|
+
"type": "(keys: TreeKey[]) => void"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"description": "获取半选节点",
|
|
83
|
+
"name": "getHalfCheckedNodes",
|
|
84
|
+
"type": "() => TreeNode[]"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"description": "获取半选节点的 key",
|
|
88
|
+
"name": "getHalfCheckedKeys",
|
|
89
|
+
"type": "() => TreeKey[]"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"description": "获取当前节点的 key",
|
|
93
|
+
"name": "getCurrentKey",
|
|
94
|
+
"type": "() => TreeKey | undefined"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"description": "获取当前节点",
|
|
98
|
+
"name": "getCurrentNode",
|
|
99
|
+
"type": "() => TreeNode | undefined"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"description": "设置当前节点的 key",
|
|
103
|
+
"name": "setCurrentKey",
|
|
104
|
+
"type": "(key: TreeKey) => void"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"description": "根据 key 获取节点",
|
|
108
|
+
"name": "getNode",
|
|
109
|
+
"type": "(key: TreeKey) => TreeNode | undefined"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"description": "设置树数据",
|
|
113
|
+
"name": "setData",
|
|
114
|
+
"type": "(data: TreeData) => void"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"description": "展开节点",
|
|
118
|
+
"name": "expandNode",
|
|
119
|
+
"type": "(node: TreeNode) => void"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"description": "收起节点",
|
|
123
|
+
"name": "collapseNode",
|
|
124
|
+
"type": "(node: TreeNode) => void"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"description": "设置展开节点的 key",
|
|
128
|
+
"name": "setExpandedKeys",
|
|
129
|
+
"type": "(keys: TreeKey[]) => void"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"description": "切换节点复选框状态",
|
|
133
|
+
"name": "toggleCheckbox",
|
|
134
|
+
"type": "(node: TreeNode, checked: boolean) => void"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"description": "滚动到指定节点",
|
|
138
|
+
"name": "scrollToNode",
|
|
139
|
+
"type": "(node: TreeNode, strategy?: string) => void"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"description": "滚动到指定位置",
|
|
143
|
+
"name": "scrollTo",
|
|
144
|
+
"type": "(offset: number) => void"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"hot": false,
|
|
148
|
+
"id": "component:tree-v2",
|
|
149
|
+
"keywords": {
|
|
150
|
+
"en": [
|
|
151
|
+
"tree-v2",
|
|
152
|
+
"tree",
|
|
153
|
+
"v2",
|
|
154
|
+
"virtual",
|
|
155
|
+
"data"
|
|
156
|
+
],
|
|
157
|
+
"zh": [
|
|
158
|
+
"虚拟化树形控件",
|
|
159
|
+
"数据"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"kind": "component",
|
|
163
|
+
"name": "EpTreeV2",
|
|
164
|
+
"nonUseCases": [
|
|
165
|
+
"数据量极小且无需结构化展示时"
|
|
166
|
+
],
|
|
167
|
+
"props": [
|
|
168
|
+
{
|
|
169
|
+
"alias": null,
|
|
170
|
+
"defaultText": "[]",
|
|
171
|
+
"description": "展示数据",
|
|
172
|
+
"hasDefault": true,
|
|
173
|
+
"name": "data",
|
|
174
|
+
"required": false,
|
|
175
|
+
"type": "TreeData"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"alias": null,
|
|
179
|
+
"defaultText": null,
|
|
180
|
+
"description": "内容为空时的文本",
|
|
181
|
+
"hasDefault": false,
|
|
182
|
+
"name": "emptyText",
|
|
183
|
+
"required": false,
|
|
184
|
+
"type": "string"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"alias": null,
|
|
188
|
+
"defaultText": "200",
|
|
189
|
+
"description": "树的高度,单位 px",
|
|
190
|
+
"hasDefault": true,
|
|
191
|
+
"name": "height",
|
|
192
|
+
"required": false,
|
|
193
|
+
"type": "number"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"alias": null,
|
|
197
|
+
"defaultText": "{ children: 'children', label: 'label', disabled: 'disabled', value: 'id' }",
|
|
198
|
+
"description": "配置选项",
|
|
199
|
+
"hasDefault": true,
|
|
200
|
+
"name": "props",
|
|
201
|
+
"required": false,
|
|
202
|
+
"type": "{ children?: string; label?: string; disabled?: string; value?: string }"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"alias": null,
|
|
206
|
+
"defaultText": "false",
|
|
207
|
+
"description": "是否高亮当前选中节点",
|
|
208
|
+
"hasDefault": false,
|
|
209
|
+
"name": "highlightCurrent",
|
|
210
|
+
"required": false,
|
|
211
|
+
"type": "boolean"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"alias": null,
|
|
215
|
+
"defaultText": "false",
|
|
216
|
+
"description": "是否显示复选框",
|
|
217
|
+
"hasDefault": false,
|
|
218
|
+
"name": "showCheckbox",
|
|
219
|
+
"required": false,
|
|
220
|
+
"type": "boolean"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"alias": null,
|
|
224
|
+
"defaultText": "[]",
|
|
225
|
+
"description": "默认勾选的节点 key 数组",
|
|
226
|
+
"hasDefault": true,
|
|
227
|
+
"name": "defaultCheckedKeys",
|
|
228
|
+
"required": false,
|
|
229
|
+
"type": "TreeKey[]"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"alias": null,
|
|
233
|
+
"defaultText": "false",
|
|
234
|
+
"description": "勾选时是否不关联父子节点",
|
|
235
|
+
"hasDefault": false,
|
|
236
|
+
"name": "checkStrictly",
|
|
237
|
+
"required": false,
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"alias": null,
|
|
242
|
+
"defaultText": "[]",
|
|
243
|
+
"description": "默认展开的节点 key 数组",
|
|
244
|
+
"hasDefault": true,
|
|
245
|
+
"name": "defaultExpandedKeys",
|
|
246
|
+
"required": false,
|
|
247
|
+
"type": "TreeKey[]"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"alias": null,
|
|
251
|
+
"defaultText": "16",
|
|
252
|
+
"description": "相邻级节点的缩进,单位 px",
|
|
253
|
+
"hasDefault": true,
|
|
254
|
+
"name": "indent",
|
|
255
|
+
"required": false,
|
|
256
|
+
"type": "number"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"alias": null,
|
|
260
|
+
"defaultText": "26",
|
|
261
|
+
"description": "节点高度,单位 px",
|
|
262
|
+
"hasDefault": true,
|
|
263
|
+
"name": "itemSize",
|
|
264
|
+
"required": false,
|
|
265
|
+
"type": "number"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"alias": null,
|
|
269
|
+
"defaultText": null,
|
|
270
|
+
"description": "自定义节点图标",
|
|
271
|
+
"hasDefault": false,
|
|
272
|
+
"name": "icon",
|
|
273
|
+
"required": false,
|
|
274
|
+
"type": "string | Component"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"alias": null,
|
|
278
|
+
"defaultText": "true",
|
|
279
|
+
"description": "点击节点时是否展开/收起",
|
|
280
|
+
"hasDefault": true,
|
|
281
|
+
"name": "expandOnClickNode",
|
|
282
|
+
"required": false,
|
|
283
|
+
"type": "boolean"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
"alias": null,
|
|
287
|
+
"defaultText": "false",
|
|
288
|
+
"description": "点击节点时是否勾选/取消勾选",
|
|
289
|
+
"hasDefault": false,
|
|
290
|
+
"name": "checkOnClickNode",
|
|
291
|
+
"required": false,
|
|
292
|
+
"type": "boolean"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"alias": null,
|
|
296
|
+
"defaultText": "true",
|
|
297
|
+
"description": "点击叶子节点时是否勾选",
|
|
298
|
+
"hasDefault": true,
|
|
299
|
+
"name": "checkOnClickLeaf",
|
|
300
|
+
"required": false,
|
|
301
|
+
"type": "boolean"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
"alias": null,
|
|
305
|
+
"defaultText": null,
|
|
306
|
+
"description": "当前选中节点的 key",
|
|
307
|
+
"hasDefault": false,
|
|
308
|
+
"name": "currentNodeKey",
|
|
309
|
+
"required": false,
|
|
310
|
+
"type": "string | number"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"alias": null,
|
|
314
|
+
"defaultText": "false",
|
|
315
|
+
"description": "是否每次只展开一个同级节点",
|
|
316
|
+
"hasDefault": false,
|
|
317
|
+
"name": "accordion",
|
|
318
|
+
"required": false,
|
|
319
|
+
"type": "boolean"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"alias": null,
|
|
323
|
+
"defaultText": null,
|
|
324
|
+
"description": "过滤节点的函数",
|
|
325
|
+
"hasDefault": false,
|
|
326
|
+
"name": "filterMethod",
|
|
327
|
+
"required": false,
|
|
328
|
+
"type": "FilterMethod"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"alias": null,
|
|
332
|
+
"defaultText": "true",
|
|
333
|
+
"description": "性能模式,可提升滚动流畅度但会增加内存占用",
|
|
334
|
+
"hasDefault": true,
|
|
335
|
+
"name": "perfMode",
|
|
336
|
+
"required": false,
|
|
337
|
+
"type": "boolean"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"alias": null,
|
|
341
|
+
"defaultText": "false",
|
|
342
|
+
"description": "是否始终显示滚动条",
|
|
343
|
+
"hasDefault": false,
|
|
344
|
+
"name": "scrollbarAlwaysOn",
|
|
345
|
+
"required": false,
|
|
346
|
+
"type": "boolean"
|
|
347
|
+
}
|
|
348
|
+
],
|
|
349
|
+
"related": [
|
|
350
|
+
"EpTree",
|
|
351
|
+
"EpTreeSelect"
|
|
352
|
+
],
|
|
353
|
+
"relations": {
|
|
354
|
+
"children": [],
|
|
355
|
+
"combos": [],
|
|
356
|
+
"parents": [],
|
|
357
|
+
"requiredChildren": []
|
|
358
|
+
},
|
|
359
|
+
"slots": [
|
|
360
|
+
{
|
|
361
|
+
"description": "自定义节点内容,参数为 `{ node, data }`",
|
|
362
|
+
"name": "default"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"description": "内容为空时的内容",
|
|
366
|
+
"name": "empty"
|
|
367
|
+
}
|
|
368
|
+
],
|
|
369
|
+
"slug": "tree-v2",
|
|
370
|
+
"summary": "虚拟化树形控件,结构化数据展示",
|
|
371
|
+
"tag": "ep-tree-v2",
|
|
372
|
+
"useCases": [
|
|
373
|
+
"展示虚拟化树形控件类结构化数据",
|
|
374
|
+
"需要浏览、比较或定位数据时"
|
|
375
|
+
],
|
|
376
|
+
"variants": [],
|
|
377
|
+
"visual": {
|
|
378
|
+
"cssVars": [
|
|
379
|
+
"--el-border-color-lighter",
|
|
380
|
+
"--el-bg-color",
|
|
381
|
+
"--el-text-color-regular",
|
|
382
|
+
"--el-font-size-base"
|
|
383
|
+
],
|
|
384
|
+
"density": "紧凑",
|
|
385
|
+
"shape": "块级数据区域",
|
|
386
|
+
"slotContent": [
|
|
387
|
+
"default:自定义节点内容,参数为 `{ node, data }`",
|
|
388
|
+
"empty:内容为空时的内容"
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
393
|
+
"libraryVersion": "0.2.0",
|
|
394
|
+
"schemaVersion": 1
|
|
395
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# EpTreeV2
|
|
2
|
+
|
|
3
|
+
`ep-tree-v2` · data(数据展示) · `component:tree-v2`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
虚拟化树形控件,结构化数据展示
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:展示虚拟化树形控件类结构化数据
|
|
12
|
+
- 适用:需要浏览、比较或定位数据时
|
|
13
|
+
- 不适用:数据量极小且无需结构化展示时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:虚拟化树形控件、数据
|
|
18
|
+
- English: tree-v2, tree, v2, virtual, data
|
|
19
|
+
|
|
20
|
+
## Props
|
|
21
|
+
|
|
22
|
+
- data (TreeData,默认 []):展示数据
|
|
23
|
+
- emptyText (string):内容为空时的文本
|
|
24
|
+
- height (number,默认 200):树的高度,单位 px
|
|
25
|
+
- props ({ children?: string; label?: string; disabled?: string; value?: string },默认 { children: 'children', label: 'label', disabled: 'disabled', value: 'id' }):配置选项
|
|
26
|
+
- highlightCurrent (boolean):是否高亮当前选中节点
|
|
27
|
+
- showCheckbox (boolean):是否显示复选框
|
|
28
|
+
- defaultCheckedKeys (TreeKey[],默认 []):默认勾选的节点 key 数组
|
|
29
|
+
- checkStrictly (boolean):勾选时是否不关联父子节点
|
|
30
|
+
- defaultExpandedKeys (TreeKey[],默认 []):默认展开的节点 key 数组
|
|
31
|
+
- indent (number,默认 16):相邻级节点的缩进,单位 px
|
|
32
|
+
- itemSize (number,默认 26):节点高度,单位 px
|
|
33
|
+
- icon (string | Component):自定义节点图标
|
|
34
|
+
- expandOnClickNode (boolean,默认 true):点击节点时是否展开/收起
|
|
35
|
+
- checkOnClickNode (boolean):点击节点时是否勾选/取消勾选
|
|
36
|
+
- checkOnClickLeaf (boolean,默认 true):点击叶子节点时是否勾选
|
|
37
|
+
- currentNodeKey (string | number):当前选中节点的 key
|
|
38
|
+
- accordion (boolean):是否每次只展开一个同级节点
|
|
39
|
+
- filterMethod (FilterMethod):过滤节点的函数
|
|
40
|
+
- perfMode (boolean,默认 true):性能模式,可提升滚动流畅度但会增加内存占用
|
|
41
|
+
- scrollbarAlwaysOn (boolean):是否始终显示滚动条
|
|
42
|
+
|
|
43
|
+
## Events
|
|
44
|
+
|
|
45
|
+
- nodeClick((data: TreeNodeData, node: TreeNode, e: MouseEvent)):点击节点时触发
|
|
46
|
+
- nodeDrop((data: TreeNodeData, node: TreeNode, e: DragEvent)):拖拽放置后触发
|
|
47
|
+
- nodeExpand((data: TreeNodeData, node: TreeNode)):节点展开时触发
|
|
48
|
+
- nodeCollapse((data: TreeNodeData, node: TreeNode)):节点收起时触发
|
|
49
|
+
- currentChange((data: TreeNodeData, node: TreeNode)):当前节点变化时触发
|
|
50
|
+
- check((data: TreeNodeData, checkedInfo: CheckedInfo)):勾选节点时触发
|
|
51
|
+
- checkChange((data: TreeNodeData, checked: boolean)):节点勾选状态变化时触发
|
|
52
|
+
- nodeContextmenu((evt: Event, data: TreeNodeData, node: TreeNode)):右键节点时触发
|
|
53
|
+
|
|
54
|
+
## Slots
|
|
55
|
+
|
|
56
|
+
- default:自定义节点内容,参数为 `{ node, data }`
|
|
57
|
+
- empty:内容为空时的内容
|
|
58
|
+
|
|
59
|
+
## Exposes
|
|
60
|
+
|
|
61
|
+
- filter((value: any) => void):过滤节点
|
|
62
|
+
- getCheckedNodes((leafOnly?: boolean) => TreeNode[]):获取勾选节点
|
|
63
|
+
- getCheckedKeys((leafOnly?: boolean) => TreeKey[]):获取勾选节点的 key
|
|
64
|
+
- setChecked((key: TreeKey, checked: boolean, deep: boolean) => void):设置节点勾选状态
|
|
65
|
+
- setCheckedKeys((keys: TreeKey[]) => void):设置勾选节点的 key
|
|
66
|
+
- getHalfCheckedNodes(() => TreeNode[]):获取半选节点
|
|
67
|
+
- getHalfCheckedKeys(() => TreeKey[]):获取半选节点的 key
|
|
68
|
+
- getCurrentKey(() => TreeKey | undefined):获取当前节点的 key
|
|
69
|
+
- getCurrentNode(() => TreeNode | undefined):获取当前节点
|
|
70
|
+
- setCurrentKey((key: TreeKey) => void):设置当前节点的 key
|
|
71
|
+
- getNode((key: TreeKey) => TreeNode | undefined):根据 key 获取节点
|
|
72
|
+
- setData((data: TreeData) => void):设置树数据
|
|
73
|
+
- expandNode((node: TreeNode) => void):展开节点
|
|
74
|
+
- collapseNode((node: TreeNode) => void):收起节点
|
|
75
|
+
- setExpandedKeys((keys: TreeKey[]) => void):设置展开节点的 key
|
|
76
|
+
- toggleCheckbox((node: TreeNode, checked: boolean) => void):切换节点复选框状态
|
|
77
|
+
- scrollToNode((node: TreeNode, strategy?: string) => void):滚动到指定节点
|
|
78
|
+
- scrollTo((offset: number) => void):滚动到指定位置
|
|
79
|
+
|
|
80
|
+
## 视觉提示
|
|
81
|
+
|
|
82
|
+
- 形状:块级数据区域
|
|
83
|
+
- 密度:紧凑
|
|
84
|
+
- 插槽内容:default:自定义节点内容,参数为 `{ node, data }`;empty:内容为空时的内容
|
|
85
|
+
- CSS 变量:--el-border-color-lighter、--el-bg-color、--el-text-color-regular、--el-font-size-base
|
|
86
|
+
|
|
87
|
+
## 示例
|
|
88
|
+
|
|
89
|
+
### 虚拟化树
|
|
90
|
+
|
|
91
|
+
```vue
|
|
92
|
+
<script setup lang="ts">
|
|
93
|
+
import { EpTreeV2 } from 'ep-craft'
|
|
94
|
+
|
|
95
|
+
const data = Array.from({ length: 50 }, (_, index) => ({
|
|
96
|
+
id: index,
|
|
97
|
+
label: `节点 ${index + 1}`,
|
|
98
|
+
}))
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<template>
|
|
102
|
+
<ep-tree-v2 :data="data" :height="240" />
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 相关条目
|
|
107
|
+
|
|
108
|
+
- EpTree
|
|
109
|
+
- EpTreeSelect
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
ep-craft 0.2.0
|