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,211 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "navigation",
|
|
4
|
+
"events": [],
|
|
5
|
+
"exampleOmittedReason": null,
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"code": "<script setup lang=\"ts\">\nimport { EpMenu, EpMenuItem, EpSubMenu } from 'ep-craft'\n</script>\n\n<template>\n <ep-menu default-openeds=\"['more']\">\n <ep-sub-menu index=\"more\">\n <template #title>更多</template>\n <ep-menu-item index=\"about\">关于</ep-menu-item>\n <ep-menu-item index=\"help\">帮助</ep-menu-item>\n </ep-sub-menu>\n </ep-menu>\n</template>",
|
|
9
|
+
"id": "sub-menu-1",
|
|
10
|
+
"language": "vue",
|
|
11
|
+
"title": "子菜单"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"exposes": [
|
|
15
|
+
{
|
|
16
|
+
"description": "子菜单是否展开",
|
|
17
|
+
"name": "opened",
|
|
18
|
+
"type": "ComputedRef<boolean>"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"hot": false,
|
|
22
|
+
"id": "component:sub-menu",
|
|
23
|
+
"keywords": {
|
|
24
|
+
"en": [
|
|
25
|
+
"sub-menu",
|
|
26
|
+
"sub",
|
|
27
|
+
"menu",
|
|
28
|
+
"submenu",
|
|
29
|
+
"navigation"
|
|
30
|
+
],
|
|
31
|
+
"zh": [
|
|
32
|
+
"子菜单",
|
|
33
|
+
"导航"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"kind": "component",
|
|
37
|
+
"name": "EpSubMenu",
|
|
38
|
+
"nonUseCases": [
|
|
39
|
+
"单步无层级的简单跳转时"
|
|
40
|
+
],
|
|
41
|
+
"props": [
|
|
42
|
+
{
|
|
43
|
+
"alias": null,
|
|
44
|
+
"defaultText": null,
|
|
45
|
+
"description": "唯一标识(必填)",
|
|
46
|
+
"hasDefault": false,
|
|
47
|
+
"name": "index",
|
|
48
|
+
"required": true,
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"alias": null,
|
|
53
|
+
"defaultText": null,
|
|
54
|
+
"description": "显示前的延迟,单位 ms",
|
|
55
|
+
"hasDefault": false,
|
|
56
|
+
"name": "showTimeout",
|
|
57
|
+
"required": false,
|
|
58
|
+
"type": "number"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"alias": null,
|
|
62
|
+
"defaultText": null,
|
|
63
|
+
"description": "隐藏前的延迟,单位 ms",
|
|
64
|
+
"hasDefault": false,
|
|
65
|
+
"name": "hideTimeout",
|
|
66
|
+
"required": false,
|
|
67
|
+
"type": "number"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"alias": null,
|
|
71
|
+
"defaultText": null,
|
|
72
|
+
"description": "弹出菜单的自定义类名",
|
|
73
|
+
"hasDefault": false,
|
|
74
|
+
"name": "popperClass",
|
|
75
|
+
"required": false,
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"alias": null,
|
|
80
|
+
"defaultText": null,
|
|
81
|
+
"description": "弹出菜单的自定义样式",
|
|
82
|
+
"hasDefault": false,
|
|
83
|
+
"name": "popperStyle",
|
|
84
|
+
"required": false,
|
|
85
|
+
"type": "string | CSSProperties"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"alias": null,
|
|
89
|
+
"defaultText": "false",
|
|
90
|
+
"description": "是否禁用",
|
|
91
|
+
"hasDefault": false,
|
|
92
|
+
"name": "disabled",
|
|
93
|
+
"required": false,
|
|
94
|
+
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"alias": null,
|
|
98
|
+
"defaultText": null,
|
|
99
|
+
"description": "弹出菜单是否挂载到 body",
|
|
100
|
+
"hasDefault": true,
|
|
101
|
+
"name": "teleported",
|
|
102
|
+
"required": false,
|
|
103
|
+
"type": "boolean"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"alias": null,
|
|
107
|
+
"defaultText": null,
|
|
108
|
+
"description": "弹出层的偏移量,覆盖 Menu 的同名配置",
|
|
109
|
+
"hasDefault": false,
|
|
110
|
+
"name": "popperOffset",
|
|
111
|
+
"required": false,
|
|
112
|
+
"type": "number"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"alias": null,
|
|
116
|
+
"defaultText": null,
|
|
117
|
+
"description": "展开状态且子菜单收起时的图标",
|
|
118
|
+
"hasDefault": false,
|
|
119
|
+
"name": "expandCloseIcon",
|
|
120
|
+
"required": false,
|
|
121
|
+
"type": "string | Component"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"alias": null,
|
|
125
|
+
"defaultText": null,
|
|
126
|
+
"description": "展开状态且子菜单打开时的图标",
|
|
127
|
+
"hasDefault": false,
|
|
128
|
+
"name": "expandOpenIcon",
|
|
129
|
+
"required": false,
|
|
130
|
+
"type": "string | Component"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"alias": null,
|
|
134
|
+
"defaultText": null,
|
|
135
|
+
"description": "折叠状态且子菜单收起时的图标",
|
|
136
|
+
"hasDefault": false,
|
|
137
|
+
"name": "collapseCloseIcon",
|
|
138
|
+
"required": false,
|
|
139
|
+
"type": "string | Component"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"alias": null,
|
|
143
|
+
"defaultText": null,
|
|
144
|
+
"description": "折叠状态且子菜单打开时的图标",
|
|
145
|
+
"hasDefault": false,
|
|
146
|
+
"name": "collapseOpenIcon",
|
|
147
|
+
"required": false,
|
|
148
|
+
"type": "string | Component"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"related": [
|
|
152
|
+
"EpMenu",
|
|
153
|
+
"EpMenuItem"
|
|
154
|
+
],
|
|
155
|
+
"relations": {
|
|
156
|
+
"children": [
|
|
157
|
+
"EpMenuItem"
|
|
158
|
+
],
|
|
159
|
+
"combos": [
|
|
160
|
+
"EpMenu + EpSubMenu",
|
|
161
|
+
"EpSubMenu + EpMenuItem"
|
|
162
|
+
],
|
|
163
|
+
"parents": [
|
|
164
|
+
"EpMenu"
|
|
165
|
+
],
|
|
166
|
+
"requiredChildren": []
|
|
167
|
+
},
|
|
168
|
+
"slots": [
|
|
169
|
+
{
|
|
170
|
+
"description": "子菜单内容",
|
|
171
|
+
"name": "default"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"description": "子菜单标题",
|
|
175
|
+
"name": "title"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"slug": "sub-menu",
|
|
179
|
+
"summary": "子菜单,页面导航与定位",
|
|
180
|
+
"tag": "ep-sub-menu",
|
|
181
|
+
"useCases": [
|
|
182
|
+
"在页面或模块间使用子菜单导航",
|
|
183
|
+
"指示当前位置与层级"
|
|
184
|
+
],
|
|
185
|
+
"variants": [
|
|
186
|
+
{
|
|
187
|
+
"dimension": "state",
|
|
188
|
+
"values": [
|
|
189
|
+
"disabled"
|
|
190
|
+
],
|
|
191
|
+
"when": "通过布尔属性切换禁用、加载或选中状态"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"visual": {
|
|
195
|
+
"cssVars": [
|
|
196
|
+
"--el-color-primary",
|
|
197
|
+
"--el-text-color-regular",
|
|
198
|
+
"--el-bg-color"
|
|
199
|
+
],
|
|
200
|
+
"density": "中等",
|
|
201
|
+
"shape": "条状或列表",
|
|
202
|
+
"slotContent": [
|
|
203
|
+
"default:子菜单内容",
|
|
204
|
+
"title:子菜单标题"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
209
|
+
"libraryVersion": "0.2.0",
|
|
210
|
+
"schemaVersion": 1
|
|
211
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# EpSubMenu
|
|
2
|
+
|
|
3
|
+
`ep-sub-menu` · navigation(导航) · `component:sub-menu`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
子菜单,页面导航与定位
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:在页面或模块间使用子菜单导航
|
|
12
|
+
- 适用:指示当前位置与层级
|
|
13
|
+
- 不适用:单步无层级的简单跳转时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:子菜单、导航
|
|
18
|
+
- English: sub-menu, sub, menu, submenu, navigation
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- state: disabled(通过布尔属性切换禁用、加载或选中状态)
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
- index (string,必填):唯一标识(必填)
|
|
27
|
+
- showTimeout (number):显示前的延迟,单位 ms
|
|
28
|
+
- hideTimeout (number):隐藏前的延迟,单位 ms
|
|
29
|
+
- popperClass (string):弹出菜单的自定义类名
|
|
30
|
+
- popperStyle (string | CSSProperties):弹出菜单的自定义样式
|
|
31
|
+
- disabled (boolean):是否禁用
|
|
32
|
+
- teleported (boolean,默认 见文档):弹出菜单是否挂载到 body
|
|
33
|
+
- popperOffset (number):弹出层的偏移量,覆盖 Menu 的同名配置
|
|
34
|
+
- expandCloseIcon (string | Component):展开状态且子菜单收起时的图标
|
|
35
|
+
- expandOpenIcon (string | Component):展开状态且子菜单打开时的图标
|
|
36
|
+
- collapseCloseIcon (string | Component):折叠状态且子菜单收起时的图标
|
|
37
|
+
- collapseOpenIcon (string | Component):折叠状态且子菜单打开时的图标
|
|
38
|
+
|
|
39
|
+
## Slots
|
|
40
|
+
|
|
41
|
+
- default:子菜单内容
|
|
42
|
+
- title:子菜单标题
|
|
43
|
+
|
|
44
|
+
## Exposes
|
|
45
|
+
|
|
46
|
+
- opened(ComputedRef<boolean>):子菜单是否展开
|
|
47
|
+
|
|
48
|
+
## 关系
|
|
49
|
+
|
|
50
|
+
- 父级:EpMenu
|
|
51
|
+
- 子级:EpMenuItem
|
|
52
|
+
- 常用组合:EpMenu + EpSubMenu、EpSubMenu + EpMenuItem
|
|
53
|
+
|
|
54
|
+
## 视觉提示
|
|
55
|
+
|
|
56
|
+
- 形状:条状或列表
|
|
57
|
+
- 密度:中等
|
|
58
|
+
- 插槽内容:default:子菜单内容;title:子菜单标题
|
|
59
|
+
- CSS 变量:--el-color-primary、--el-text-color-regular、--el-bg-color
|
|
60
|
+
|
|
61
|
+
## 示例
|
|
62
|
+
|
|
63
|
+
### 子菜单
|
|
64
|
+
|
|
65
|
+
```vue
|
|
66
|
+
<script setup lang="ts">
|
|
67
|
+
import { EpMenu, EpMenuItem, EpSubMenu } from 'ep-craft'
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<ep-menu default-openeds="['more']">
|
|
72
|
+
<ep-sub-menu index="more">
|
|
73
|
+
<template #title>更多</template>
|
|
74
|
+
<ep-menu-item index="about">关于</ep-menu-item>
|
|
75
|
+
<ep-menu-item index="help">帮助</ep-menu-item>
|
|
76
|
+
</ep-sub-menu>
|
|
77
|
+
</ep-menu>
|
|
78
|
+
</template>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## 相关条目
|
|
82
|
+
|
|
83
|
+
- EpMenu
|
|
84
|
+
- EpMenuItem
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "form",
|
|
4
|
+
"events": [
|
|
5
|
+
{
|
|
6
|
+
"description": "绑定值变化时触发",
|
|
7
|
+
"name": "update:modelValue",
|
|
8
|
+
"params": "(value: boolean | string | number)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"description": "switch 状态发生变化时的回调",
|
|
12
|
+
"name": "change",
|
|
13
|
+
"params": "(value: boolean | string | number)"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"description": "绑定值变化时触发(兼容事件名,建议使用 update:model-value)",
|
|
17
|
+
"name": "input",
|
|
18
|
+
"params": "(value: boolean | string | number)"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"exampleOmittedReason": null,
|
|
22
|
+
"examples": [
|
|
23
|
+
{
|
|
24
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpSwitch } from 'ep-craft'\n\nconst value = ref(true)\n</script>\n\n<template>\n <ep-switch v-model=\"value\" active-text=\"开\" inactive-text=\"关\" />\n</template>",
|
|
25
|
+
"id": "switch-1",
|
|
26
|
+
"language": "vue",
|
|
27
|
+
"title": "开关"
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"exposes": [
|
|
31
|
+
{
|
|
32
|
+
"description": "使 Switch 获取焦点",
|
|
33
|
+
"name": "focus",
|
|
34
|
+
"type": "() => void"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"hot": false,
|
|
38
|
+
"id": "component:switch",
|
|
39
|
+
"keywords": {
|
|
40
|
+
"en": [
|
|
41
|
+
"switch",
|
|
42
|
+
"toggle",
|
|
43
|
+
"form"
|
|
44
|
+
],
|
|
45
|
+
"zh": [
|
|
46
|
+
"开关",
|
|
47
|
+
"表单"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"kind": "component",
|
|
51
|
+
"name": "EpSwitch",
|
|
52
|
+
"nonUseCases": [
|
|
53
|
+
"仅展示静态文本或只读数据时"
|
|
54
|
+
],
|
|
55
|
+
"props": [
|
|
56
|
+
{
|
|
57
|
+
"alias": "v-model",
|
|
58
|
+
"defaultText": null,
|
|
59
|
+
"description": "绑定值",
|
|
60
|
+
"hasDefault": true,
|
|
61
|
+
"name": "modelValue",
|
|
62
|
+
"required": false,
|
|
63
|
+
"type": "boolean | string | number"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"alias": null,
|
|
67
|
+
"defaultText": "false",
|
|
68
|
+
"description": "是否禁用",
|
|
69
|
+
"hasDefault": true,
|
|
70
|
+
"name": "disabled",
|
|
71
|
+
"required": false,
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"alias": null,
|
|
76
|
+
"defaultText": "false",
|
|
77
|
+
"description": "是否显示加载中",
|
|
78
|
+
"hasDefault": false,
|
|
79
|
+
"name": "loading",
|
|
80
|
+
"required": false,
|
|
81
|
+
"type": "boolean"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"alias": null,
|
|
85
|
+
"defaultText": "default",
|
|
86
|
+
"description": "switch 的大小",
|
|
87
|
+
"hasDefault": false,
|
|
88
|
+
"name": "size",
|
|
89
|
+
"required": false,
|
|
90
|
+
"type": "'large' | 'default' | 'small'"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"alias": null,
|
|
94
|
+
"defaultText": "''",
|
|
95
|
+
"description": "switch 的宽度",
|
|
96
|
+
"hasDefault": true,
|
|
97
|
+
"name": "width",
|
|
98
|
+
"required": false,
|
|
99
|
+
"type": "number | string"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"alias": null,
|
|
103
|
+
"defaultText": "false",
|
|
104
|
+
"description": "无论图标或文本是否显示在点内",
|
|
105
|
+
"hasDefault": false,
|
|
106
|
+
"name": "inlinePrompt",
|
|
107
|
+
"required": false,
|
|
108
|
+
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"alias": null,
|
|
112
|
+
"defaultText": null,
|
|
113
|
+
"description": "",
|
|
114
|
+
"hasDefault": false,
|
|
115
|
+
"name": "inactiveActionIcon",
|
|
116
|
+
"required": false,
|
|
117
|
+
"type": "unknown"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"alias": null,
|
|
121
|
+
"defaultText": null,
|
|
122
|
+
"description": "",
|
|
123
|
+
"hasDefault": false,
|
|
124
|
+
"name": "activeActionIcon",
|
|
125
|
+
"required": false,
|
|
126
|
+
"type": "unknown"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"alias": null,
|
|
130
|
+
"defaultText": null,
|
|
131
|
+
"description": "switch 状态为 on 时所显示图标",
|
|
132
|
+
"hasDefault": false,
|
|
133
|
+
"name": "activeIcon",
|
|
134
|
+
"required": false,
|
|
135
|
+
"type": "string | Component"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"alias": null,
|
|
139
|
+
"defaultText": null,
|
|
140
|
+
"description": "switch 状态为 off 时所显示图标",
|
|
141
|
+
"hasDefault": false,
|
|
142
|
+
"name": "inactiveIcon",
|
|
143
|
+
"required": false,
|
|
144
|
+
"type": "string | Component"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"alias": null,
|
|
148
|
+
"defaultText": "''",
|
|
149
|
+
"description": "switch 打开时的文字描述",
|
|
150
|
+
"hasDefault": true,
|
|
151
|
+
"name": "activeText",
|
|
152
|
+
"required": false,
|
|
153
|
+
"type": "string"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"alias": null,
|
|
157
|
+
"defaultText": "''",
|
|
158
|
+
"description": "switch 关闭时的文字描述",
|
|
159
|
+
"hasDefault": true,
|
|
160
|
+
"name": "inactiveText",
|
|
161
|
+
"required": false,
|
|
162
|
+
"type": "string"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"alias": null,
|
|
166
|
+
"defaultText": "true",
|
|
167
|
+
"description": "switch 状态为 on 时的值",
|
|
168
|
+
"hasDefault": true,
|
|
169
|
+
"name": "activeValue",
|
|
170
|
+
"required": false,
|
|
171
|
+
"type": "boolean | string | number"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"alias": null,
|
|
175
|
+
"defaultText": "false",
|
|
176
|
+
"description": "switch 状态为 off 时的值",
|
|
177
|
+
"hasDefault": true,
|
|
178
|
+
"name": "inactiveValue",
|
|
179
|
+
"required": false,
|
|
180
|
+
"type": "boolean | string | number"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"alias": null,
|
|
184
|
+
"defaultText": "''",
|
|
185
|
+
"description": "原生 name 属性",
|
|
186
|
+
"hasDefault": true,
|
|
187
|
+
"name": "name",
|
|
188
|
+
"required": false,
|
|
189
|
+
"type": "string"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"alias": null,
|
|
193
|
+
"defaultText": "true",
|
|
194
|
+
"description": "改变 switch 状态时是否触发表单验证",
|
|
195
|
+
"hasDefault": true,
|
|
196
|
+
"name": "validateEvent",
|
|
197
|
+
"required": false,
|
|
198
|
+
"type": "boolean"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"alias": null,
|
|
202
|
+
"defaultText": null,
|
|
203
|
+
"description": "switch 状态改变前的钩子",
|
|
204
|
+
"hasDefault": false,
|
|
205
|
+
"name": "beforeChange",
|
|
206
|
+
"required": false,
|
|
207
|
+
"type": "() => Promise<boolean> | boolean"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"alias": null,
|
|
211
|
+
"defaultText": null,
|
|
212
|
+
"description": "",
|
|
213
|
+
"hasDefault": false,
|
|
214
|
+
"name": "id",
|
|
215
|
+
"required": false,
|
|
216
|
+
"type": "unknown"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"alias": null,
|
|
220
|
+
"defaultText": null,
|
|
221
|
+
"description": "",
|
|
222
|
+
"hasDefault": false,
|
|
223
|
+
"name": "tabindex",
|
|
224
|
+
"required": false,
|
|
225
|
+
"type": "unknown"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"alias": null,
|
|
229
|
+
"defaultText": null,
|
|
230
|
+
"description": "",
|
|
231
|
+
"hasDefault": false,
|
|
232
|
+
"name": "ariaLabel",
|
|
233
|
+
"required": false,
|
|
234
|
+
"type": "unknown"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"related": [
|
|
238
|
+
"EpCheckbox"
|
|
239
|
+
],
|
|
240
|
+
"relations": {
|
|
241
|
+
"children": [],
|
|
242
|
+
"combos": [],
|
|
243
|
+
"parents": [],
|
|
244
|
+
"requiredChildren": []
|
|
245
|
+
},
|
|
246
|
+
"slots": [],
|
|
247
|
+
"slug": "switch",
|
|
248
|
+
"summary": "开关,表单数据录入控件",
|
|
249
|
+
"tag": "ep-switch",
|
|
250
|
+
"useCases": [
|
|
251
|
+
"表单中收集或编辑开关数据",
|
|
252
|
+
"与 EpForm、EpFormItem 组合完成校验"
|
|
253
|
+
],
|
|
254
|
+
"variants": [
|
|
255
|
+
{
|
|
256
|
+
"dimension": "size",
|
|
257
|
+
"values": [
|
|
258
|
+
"large",
|
|
259
|
+
"default",
|
|
260
|
+
"small"
|
|
261
|
+
],
|
|
262
|
+
"when": "按容器空间与信息密度选择尺寸"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"dimension": "state",
|
|
266
|
+
"values": [
|
|
267
|
+
"disabled",
|
|
268
|
+
"loading"
|
|
269
|
+
],
|
|
270
|
+
"when": "通过布尔属性切换禁用、加载或选中状态"
|
|
271
|
+
}
|
|
272
|
+
],
|
|
273
|
+
"visual": {
|
|
274
|
+
"cssVars": [
|
|
275
|
+
"--el-border-color",
|
|
276
|
+
"--el-border-radius-base",
|
|
277
|
+
"--el-color-primary",
|
|
278
|
+
"--el-font-size-base"
|
|
279
|
+
],
|
|
280
|
+
"density": "中等",
|
|
281
|
+
"shape": "矩形输入框",
|
|
282
|
+
"slotContent": [
|
|
283
|
+
"active:自定义内容",
|
|
284
|
+
"active-action:自定义内容",
|
|
285
|
+
"inactive:自定义内容"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
290
|
+
"libraryVersion": "0.2.0",
|
|
291
|
+
"schemaVersion": 1
|
|
292
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# EpSwitch
|
|
2
|
+
|
|
3
|
+
`ep-switch` · form(表单) · `component:switch`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
开关,表单数据录入控件
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:表单中收集或编辑开关数据
|
|
12
|
+
- 适用:与 EpForm、EpFormItem 组合完成校验
|
|
13
|
+
- 不适用:仅展示静态文本或只读数据时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:开关、表单
|
|
18
|
+
- English: switch, toggle, form
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- size: large/default/small(按容器空间与信息密度选择尺寸)
|
|
23
|
+
- state: disabled/loading(通过布尔属性切换禁用、加载或选中状态)
|
|
24
|
+
|
|
25
|
+
## Props
|
|
26
|
+
|
|
27
|
+
- modelValue(别名 v-model) (boolean | string | number,默认 见文档):绑定值
|
|
28
|
+
- disabled (boolean,默认 false):是否禁用
|
|
29
|
+
- loading (boolean):是否显示加载中
|
|
30
|
+
- size ('large' | 'default' | 'small'):switch 的大小
|
|
31
|
+
- width (number | string,默认 ''):switch 的宽度
|
|
32
|
+
- inlinePrompt (boolean):无论图标或文本是否显示在点内
|
|
33
|
+
- inactiveActionIcon (unknown)
|
|
34
|
+
- activeActionIcon (unknown)
|
|
35
|
+
- activeIcon (string | Component):switch 状态为 on 时所显示图标
|
|
36
|
+
- inactiveIcon (string | Component):switch 状态为 off 时所显示图标
|
|
37
|
+
- activeText (string,默认 ''):switch 打开时的文字描述
|
|
38
|
+
- inactiveText (string,默认 ''):switch 关闭时的文字描述
|
|
39
|
+
- activeValue (boolean | string | number,默认 true):switch 状态为 on 时的值
|
|
40
|
+
- inactiveValue (boolean | string | number,默认 false):switch 状态为 off 时的值
|
|
41
|
+
- name (string,默认 ''):原生 name 属性
|
|
42
|
+
- validateEvent (boolean,默认 true):改变 switch 状态时是否触发表单验证
|
|
43
|
+
- beforeChange (() => Promise<boolean> | boolean):switch 状态改变前的钩子
|
|
44
|
+
- id (unknown)
|
|
45
|
+
- tabindex (unknown)
|
|
46
|
+
- ariaLabel (unknown)
|
|
47
|
+
|
|
48
|
+
## Events
|
|
49
|
+
|
|
50
|
+
- update:modelValue((value: boolean | string | number)):绑定值变化时触发
|
|
51
|
+
- change((value: boolean | string | number)):switch 状态发生变化时的回调
|
|
52
|
+
- input((value: boolean | string | number)):绑定值变化时触发(兼容事件名,建议使用 update:model-value)
|
|
53
|
+
|
|
54
|
+
## Exposes
|
|
55
|
+
|
|
56
|
+
- focus(() => void):使 Switch 获取焦点
|
|
57
|
+
|
|
58
|
+
## 视觉提示
|
|
59
|
+
|
|
60
|
+
- 形状:矩形输入框
|
|
61
|
+
- 密度:中等
|
|
62
|
+
- 插槽内容:active:自定义内容;active-action:自定义内容;inactive:自定义内容
|
|
63
|
+
- CSS 变量:--el-border-color、--el-border-radius-base、--el-color-primary、--el-font-size-base
|
|
64
|
+
|
|
65
|
+
## 示例
|
|
66
|
+
|
|
67
|
+
### 开关
|
|
68
|
+
|
|
69
|
+
```vue
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
import { ref } from 'vue'
|
|
72
|
+
import { EpSwitch } from 'ep-craft'
|
|
73
|
+
|
|
74
|
+
const value = ref(true)
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<ep-switch v-model="value" active-text="开" inactive-text="关" />
|
|
79
|
+
</template>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## 相关条目
|
|
83
|
+
|
|
84
|
+
- EpCheckbox
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
ep-craft 0.2.0
|