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,382 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "form",
|
|
4
|
+
"events": [],
|
|
5
|
+
"exampleOmittedReason": null,
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"code": "<script setup lang=\"ts\">\nimport { EpButton, EpUpload } from 'ep-craft'\n</script>\n\n<template>\n <ep-upload action=\"/api/upload\">\n <ep-button type=\"primary\">点击上传</ep-button>\n </ep-upload>\n</template>",
|
|
9
|
+
"id": "upload-1",
|
|
10
|
+
"language": "vue",
|
|
11
|
+
"title": "点击上传"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"code": "<script setup lang=\"ts\">\nimport { EpUpload } from 'ep-craft'\n</script>\n\n<template>\n <ep-upload action=\"/api/upload\" drag>\n <p>将文件拖到此处,或点击选择</p>\n </ep-upload>\n</template>",
|
|
15
|
+
"id": "upload-2",
|
|
16
|
+
"language": "vue",
|
|
17
|
+
"title": "拖拽上传"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "<script setup lang=\"ts\">\nimport { EpButton, EpUpload } from 'ep-craft'\n</script>\n\n<template>\n <ep-upload action=\"/api/upload\" multiple :limit=\"3\">\n <ep-button type=\"primary\">最多上传 3 个文件</ep-button>\n <template #tip>\n <div>仅支持单个文件不超过 10MB</div>\n </template>\n </ep-upload>\n</template>",
|
|
21
|
+
"id": "upload-3",
|
|
22
|
+
"language": "vue",
|
|
23
|
+
"title": "限制数量"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"exposes": [
|
|
27
|
+
{
|
|
28
|
+
"description": "取消上传请求",
|
|
29
|
+
"name": "abort",
|
|
30
|
+
"type": "(file: UploadFile) => void"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"description": "手动上传文件列表",
|
|
34
|
+
"name": "submit",
|
|
35
|
+
"type": "() => void"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"description": "清空已上传的文件列表",
|
|
39
|
+
"name": "clearFiles",
|
|
40
|
+
"type": "(status?: UploadStatus[]) => void"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"description": "手动选择文件",
|
|
44
|
+
"name": "handleStart",
|
|
45
|
+
"type": "(rawFile: UploadRawFile) => void"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"description": "手动移除文件",
|
|
49
|
+
"name": "handleRemove",
|
|
50
|
+
"type": "(file: UploadFile | UploadRawFile, rawFile?: UploadRawFile) => void"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"hot": true,
|
|
54
|
+
"id": "component:upload",
|
|
55
|
+
"keywords": {
|
|
56
|
+
"en": [
|
|
57
|
+
"upload",
|
|
58
|
+
"file",
|
|
59
|
+
"attachment",
|
|
60
|
+
"form"
|
|
61
|
+
],
|
|
62
|
+
"zh": [
|
|
63
|
+
"上传",
|
|
64
|
+
"文件",
|
|
65
|
+
"附件",
|
|
66
|
+
"表单"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"kind": "component",
|
|
70
|
+
"name": "EpUpload",
|
|
71
|
+
"nonUseCases": [
|
|
72
|
+
"仅展示静态文本或只读数据时"
|
|
73
|
+
],
|
|
74
|
+
"props": [
|
|
75
|
+
{
|
|
76
|
+
"alias": null,
|
|
77
|
+
"defaultText": null,
|
|
78
|
+
"description": "上传文件之前的钩子",
|
|
79
|
+
"hasDefault": true,
|
|
80
|
+
"name": "beforeUpload",
|
|
81
|
+
"required": false,
|
|
82
|
+
"type": "(rawFile: UploadRawFile) => Awaitable<boolean | void | File | Blob | null | undefined>"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"alias": null,
|
|
86
|
+
"defaultText": null,
|
|
87
|
+
"description": "删除文件之前的钩子",
|
|
88
|
+
"hasDefault": false,
|
|
89
|
+
"name": "beforeRemove",
|
|
90
|
+
"required": false,
|
|
91
|
+
"type": "(uploadFile: UploadFile, uploadFiles: UploadFiles) => Awaitable<boolean>"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"alias": null,
|
|
95
|
+
"defaultText": null,
|
|
96
|
+
"description": "文件列表移除文件时的钩子",
|
|
97
|
+
"hasDefault": true,
|
|
98
|
+
"name": "onRemove",
|
|
99
|
+
"required": false,
|
|
100
|
+
"type": "(uploadFile: UploadFile, uploadFiles: UploadFiles) => void"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"alias": null,
|
|
104
|
+
"defaultText": null,
|
|
105
|
+
"description": "文件状态改变时的钩子",
|
|
106
|
+
"hasDefault": true,
|
|
107
|
+
"name": "onChange",
|
|
108
|
+
"required": false,
|
|
109
|
+
"type": "(uploadFile: UploadFile, uploadFiles: UploadFiles) => void"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"alias": null,
|
|
113
|
+
"defaultText": null,
|
|
114
|
+
"description": "点击文件列表中已上传的文件时的钩子",
|
|
115
|
+
"hasDefault": true,
|
|
116
|
+
"name": "onPreview",
|
|
117
|
+
"required": false,
|
|
118
|
+
"type": "(uploadFile: UploadFile) => void"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"alias": null,
|
|
122
|
+
"defaultText": null,
|
|
123
|
+
"description": "文件上传成功时的钩子",
|
|
124
|
+
"hasDefault": true,
|
|
125
|
+
"name": "onSuccess",
|
|
126
|
+
"required": false,
|
|
127
|
+
"type": "(response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => void"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"alias": null,
|
|
131
|
+
"defaultText": null,
|
|
132
|
+
"description": "文件上传时的钩子",
|
|
133
|
+
"hasDefault": true,
|
|
134
|
+
"name": "onProgress",
|
|
135
|
+
"required": false,
|
|
136
|
+
"type": "(event: UploadProgressEvent, uploadFile: UploadFile, uploadFiles: UploadFiles) => void"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"alias": null,
|
|
140
|
+
"defaultText": null,
|
|
141
|
+
"description": "文件上传失败时的钩子",
|
|
142
|
+
"hasDefault": true,
|
|
143
|
+
"name": "onError",
|
|
144
|
+
"required": false,
|
|
145
|
+
"type": "(error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"alias": null,
|
|
149
|
+
"defaultText": null,
|
|
150
|
+
"description": "当超出限制时执行的钩子函数",
|
|
151
|
+
"hasDefault": true,
|
|
152
|
+
"name": "onExceed",
|
|
153
|
+
"required": false,
|
|
154
|
+
"type": "(files: File[], uploadFiles: UploadUserFile[]) => void"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"alias": null,
|
|
158
|
+
"defaultText": null,
|
|
159
|
+
"description": "",
|
|
160
|
+
"hasDefault": false,
|
|
161
|
+
"name": "crossorigin",
|
|
162
|
+
"required": false,
|
|
163
|
+
"type": "unknown"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"alias": null,
|
|
167
|
+
"defaultText": "'#'",
|
|
168
|
+
"description": "请求 URL",
|
|
169
|
+
"hasDefault": true,
|
|
170
|
+
"name": "action",
|
|
171
|
+
"required": false,
|
|
172
|
+
"type": "string"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"alias": null,
|
|
176
|
+
"defaultText": null,
|
|
177
|
+
"description": "设置上传的请求头部",
|
|
178
|
+
"hasDefault": false,
|
|
179
|
+
"name": "headers",
|
|
180
|
+
"required": false,
|
|
181
|
+
"type": "Record<string, any>"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"alias": null,
|
|
185
|
+
"defaultText": "post",
|
|
186
|
+
"description": "设置上传请求方法",
|
|
187
|
+
"hasDefault": true,
|
|
188
|
+
"name": "method",
|
|
189
|
+
"required": false,
|
|
190
|
+
"type": "string"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"alias": null,
|
|
194
|
+
"defaultText": "{}",
|
|
195
|
+
"description": "上传时附带的额外参数",
|
|
196
|
+
"hasDefault": true,
|
|
197
|
+
"name": "data",
|
|
198
|
+
"required": false,
|
|
199
|
+
"type": "Record<string, any> | (rawFile: UploadRawFile) => Record<string, any> | Promise<Record<string, any>>"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"alias": null,
|
|
203
|
+
"defaultText": "false",
|
|
204
|
+
"description": "是否支持多选文件",
|
|
205
|
+
"hasDefault": false,
|
|
206
|
+
"name": "multiple",
|
|
207
|
+
"required": false,
|
|
208
|
+
"type": "boolean"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"alias": null,
|
|
212
|
+
"defaultText": "file",
|
|
213
|
+
"description": "上传的文件字段名",
|
|
214
|
+
"hasDefault": true,
|
|
215
|
+
"name": "name",
|
|
216
|
+
"required": false,
|
|
217
|
+
"type": "string"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"alias": null,
|
|
221
|
+
"defaultText": "false",
|
|
222
|
+
"description": "是否启用拖拽上传",
|
|
223
|
+
"hasDefault": false,
|
|
224
|
+
"name": "drag",
|
|
225
|
+
"required": false,
|
|
226
|
+
"type": "boolean"
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"alias": null,
|
|
230
|
+
"defaultText": "false",
|
|
231
|
+
"description": "是否携带 cookie",
|
|
232
|
+
"hasDefault": false,
|
|
233
|
+
"name": "withCredentials",
|
|
234
|
+
"required": false,
|
|
235
|
+
"type": "boolean"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"alias": null,
|
|
239
|
+
"defaultText": "true",
|
|
240
|
+
"description": "是否显示已上传文件列表",
|
|
241
|
+
"hasDefault": true,
|
|
242
|
+
"name": "showFileList",
|
|
243
|
+
"required": false,
|
|
244
|
+
"type": "boolean"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"alias": null,
|
|
248
|
+
"defaultText": null,
|
|
249
|
+
"description": "接受上传的文件类型",
|
|
250
|
+
"hasDefault": true,
|
|
251
|
+
"name": "accept",
|
|
252
|
+
"required": false,
|
|
253
|
+
"type": "string"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"alias": "v-model:file-list",
|
|
257
|
+
"defaultText": "[]",
|
|
258
|
+
"description": "默认上传文件",
|
|
259
|
+
"hasDefault": true,
|
|
260
|
+
"name": "fileList",
|
|
261
|
+
"required": false,
|
|
262
|
+
"type": "UploadUserFile[]"
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"alias": null,
|
|
266
|
+
"defaultText": "true",
|
|
267
|
+
"description": "是否自动上传文件",
|
|
268
|
+
"hasDefault": true,
|
|
269
|
+
"name": "autoUpload",
|
|
270
|
+
"required": false,
|
|
271
|
+
"type": "boolean"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"alias": null,
|
|
275
|
+
"defaultText": "text",
|
|
276
|
+
"description": "文件列表的类型",
|
|
277
|
+
"hasDefault": true,
|
|
278
|
+
"name": "listType",
|
|
279
|
+
"required": false,
|
|
280
|
+
"type": "'text' | 'picture' | 'picture-card'"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"alias": null,
|
|
284
|
+
"defaultText": null,
|
|
285
|
+
"description": "覆盖默认的 Xhr 行为",
|
|
286
|
+
"hasDefault": true,
|
|
287
|
+
"name": "httpRequest",
|
|
288
|
+
"required": false,
|
|
289
|
+
"type": "(options: UploadRequestOptions) => XMLHttpRequest | Promise<unknown>"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"alias": null,
|
|
293
|
+
"defaultText": "false",
|
|
294
|
+
"description": "是否禁用上传",
|
|
295
|
+
"hasDefault": true,
|
|
296
|
+
"name": "disabled",
|
|
297
|
+
"required": false,
|
|
298
|
+
"type": "boolean"
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"alias": null,
|
|
302
|
+
"defaultText": null,
|
|
303
|
+
"description": "允许上传文件的最大数量",
|
|
304
|
+
"hasDefault": false,
|
|
305
|
+
"name": "limit",
|
|
306
|
+
"required": false,
|
|
307
|
+
"type": "number"
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
"alias": null,
|
|
311
|
+
"defaultText": null,
|
|
312
|
+
"description": "",
|
|
313
|
+
"hasDefault": false,
|
|
314
|
+
"name": "directory",
|
|
315
|
+
"required": false,
|
|
316
|
+
"type": "unknown"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
"related": [
|
|
320
|
+
"EpButton",
|
|
321
|
+
"EpProgress"
|
|
322
|
+
],
|
|
323
|
+
"relations": {
|
|
324
|
+
"children": [],
|
|
325
|
+
"combos": [],
|
|
326
|
+
"parents": [],
|
|
327
|
+
"requiredChildren": []
|
|
328
|
+
},
|
|
329
|
+
"slots": [
|
|
330
|
+
{
|
|
331
|
+
"description": "自定义默认内容",
|
|
332
|
+
"name": "default"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"description": "触发文件选择框的内容",
|
|
336
|
+
"name": "trigger"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"description": "提示说明文字",
|
|
340
|
+
"name": "tip"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"description": "缩略图模板的内容",
|
|
344
|
+
"name": "file"
|
|
345
|
+
}
|
|
346
|
+
],
|
|
347
|
+
"slug": "upload",
|
|
348
|
+
"summary": "文件上传,选择、拖拽并展示进度",
|
|
349
|
+
"tag": "ep-upload",
|
|
350
|
+
"useCases": [
|
|
351
|
+
"附件与图片上传",
|
|
352
|
+
"批量文件提交与进度反馈"
|
|
353
|
+
],
|
|
354
|
+
"variants": [
|
|
355
|
+
{
|
|
356
|
+
"dimension": "state",
|
|
357
|
+
"values": [
|
|
358
|
+
"disabled"
|
|
359
|
+
],
|
|
360
|
+
"when": "通过布尔属性切换禁用、加载或选中状态"
|
|
361
|
+
}
|
|
362
|
+
],
|
|
363
|
+
"visual": {
|
|
364
|
+
"cssVars": [
|
|
365
|
+
"--el-border-color",
|
|
366
|
+
"--el-border-radius-base",
|
|
367
|
+
"--el-color-primary",
|
|
368
|
+
"--el-font-size-base"
|
|
369
|
+
],
|
|
370
|
+
"density": "中等",
|
|
371
|
+
"shape": "矩形输入框",
|
|
372
|
+
"slotContent": [
|
|
373
|
+
"default:自定义默认内容",
|
|
374
|
+
"trigger:触发文件选择框的内容",
|
|
375
|
+
"tip:提示说明文字"
|
|
376
|
+
]
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
380
|
+
"libraryVersion": "0.2.0",
|
|
381
|
+
"schemaVersion": 1
|
|
382
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# EpUpload
|
|
2
|
+
|
|
3
|
+
`ep-upload` · form(表单) · `component:upload`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
文件上传,选择、拖拽并展示进度
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:附件与图片上传
|
|
12
|
+
- 适用:批量文件提交与进度反馈
|
|
13
|
+
- 不适用:仅展示静态文本或只读数据时
|
|
14
|
+
|
|
15
|
+
## 关键词
|
|
16
|
+
|
|
17
|
+
- 中文:上传、文件、附件、表单
|
|
18
|
+
- English: upload, file, attachment, form
|
|
19
|
+
|
|
20
|
+
## 变体
|
|
21
|
+
|
|
22
|
+
- state: disabled(通过布尔属性切换禁用、加载或选中状态)
|
|
23
|
+
|
|
24
|
+
## Props
|
|
25
|
+
|
|
26
|
+
- beforeUpload ((rawFile: UploadRawFile) => Awaitable<boolean | void | File | Blob | null | undefined>,默认 见文档):上传文件之前的钩子
|
|
27
|
+
- beforeRemove ((uploadFile: UploadFile, uploadFiles: UploadFiles) => Awaitable<boolean>):删除文件之前的钩子
|
|
28
|
+
- onRemove ((uploadFile: UploadFile, uploadFiles: UploadFiles) => void,默认 见文档):文件列表移除文件时的钩子
|
|
29
|
+
- onChange ((uploadFile: UploadFile, uploadFiles: UploadFiles) => void,默认 见文档):文件状态改变时的钩子
|
|
30
|
+
- onPreview ((uploadFile: UploadFile) => void,默认 见文档):点击文件列表中已上传的文件时的钩子
|
|
31
|
+
- onSuccess ((response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => void,默认 见文档):文件上传成功时的钩子
|
|
32
|
+
- onProgress ((event: UploadProgressEvent, uploadFile: UploadFile, uploadFiles: UploadFiles) => void,默认 见文档):文件上传时的钩子
|
|
33
|
+
- onError ((error: Error, uploadFile: UploadFile, uploadFiles: UploadFiles) => void,默认 见文档):文件上传失败时的钩子
|
|
34
|
+
- onExceed ((files: File[], uploadFiles: UploadUserFile[]) => void,默认 见文档):当超出限制时执行的钩子函数
|
|
35
|
+
- crossorigin (unknown)
|
|
36
|
+
- action (string,默认 '#'):请求 URL
|
|
37
|
+
- headers (Record<string, any>):设置上传的请求头部
|
|
38
|
+
- method (string,默认 post):设置上传请求方法
|
|
39
|
+
- data (Record<string, any> | (rawFile: UploadRawFile) => Record<string, any> | Promise<Record<string, any>>,默认 {}):上传时附带的额外参数
|
|
40
|
+
- multiple (boolean):是否支持多选文件
|
|
41
|
+
- name (string,默认 file):上传的文件字段名
|
|
42
|
+
- drag (boolean):是否启用拖拽上传
|
|
43
|
+
- withCredentials (boolean):是否携带 cookie
|
|
44
|
+
- showFileList (boolean,默认 true):是否显示已上传文件列表
|
|
45
|
+
- accept (string,默认 见文档):接受上传的文件类型
|
|
46
|
+
- fileList(别名 v-model:file-list) (UploadUserFile[],默认 []):默认上传文件
|
|
47
|
+
- autoUpload (boolean,默认 true):是否自动上传文件
|
|
48
|
+
- listType ('text' | 'picture' | 'picture-card',默认 text):文件列表的类型
|
|
49
|
+
- httpRequest ((options: UploadRequestOptions) => XMLHttpRequest | Promise<unknown>,默认 见文档):覆盖默认的 Xhr 行为
|
|
50
|
+
- disabled (boolean,默认 false):是否禁用上传
|
|
51
|
+
- limit (number):允许上传文件的最大数量
|
|
52
|
+
- directory (unknown)
|
|
53
|
+
|
|
54
|
+
## Slots
|
|
55
|
+
|
|
56
|
+
- default:自定义默认内容
|
|
57
|
+
- trigger:触发文件选择框的内容
|
|
58
|
+
- tip:提示说明文字
|
|
59
|
+
- file:缩略图模板的内容
|
|
60
|
+
|
|
61
|
+
## Exposes
|
|
62
|
+
|
|
63
|
+
- abort((file: UploadFile) => void):取消上传请求
|
|
64
|
+
- submit(() => void):手动上传文件列表
|
|
65
|
+
- clearFiles((status?: UploadStatus[]) => void):清空已上传的文件列表
|
|
66
|
+
- handleStart((rawFile: UploadRawFile) => void):手动选择文件
|
|
67
|
+
- handleRemove((file: UploadFile | UploadRawFile, rawFile?: UploadRawFile) => void):手动移除文件
|
|
68
|
+
|
|
69
|
+
## 视觉提示
|
|
70
|
+
|
|
71
|
+
- 形状:矩形输入框
|
|
72
|
+
- 密度:中等
|
|
73
|
+
- 插槽内容:default:自定义默认内容;trigger:触发文件选择框的内容;tip:提示说明文字
|
|
74
|
+
- CSS 变量:--el-border-color、--el-border-radius-base、--el-color-primary、--el-font-size-base
|
|
75
|
+
|
|
76
|
+
## 示例
|
|
77
|
+
|
|
78
|
+
### 点击上传
|
|
79
|
+
|
|
80
|
+
```vue
|
|
81
|
+
<script setup lang="ts">
|
|
82
|
+
import { EpButton, EpUpload } from 'ep-craft'
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<template>
|
|
86
|
+
<ep-upload action="/api/upload">
|
|
87
|
+
<ep-button type="primary">点击上传</ep-button>
|
|
88
|
+
</ep-upload>
|
|
89
|
+
</template>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 拖拽上传
|
|
93
|
+
|
|
94
|
+
```vue
|
|
95
|
+
<script setup lang="ts">
|
|
96
|
+
import { EpUpload } from 'ep-craft'
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<ep-upload action="/api/upload" drag>
|
|
101
|
+
<p>将文件拖到此处,或点击选择</p>
|
|
102
|
+
</ep-upload>
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 限制数量
|
|
107
|
+
|
|
108
|
+
```vue
|
|
109
|
+
<script setup lang="ts">
|
|
110
|
+
import { EpButton, EpUpload } from 'ep-craft'
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<template>
|
|
114
|
+
<ep-upload action="/api/upload" multiple :limit="3">
|
|
115
|
+
<ep-button type="primary">最多上传 3 个文件</ep-button>
|
|
116
|
+
<template #tip>
|
|
117
|
+
<div>仅支持单个文件不超过 10MB</div>
|
|
118
|
+
</template>
|
|
119
|
+
</ep-upload>
|
|
120
|
+
</template>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## 相关条目
|
|
124
|
+
|
|
125
|
+
- EpButton
|
|
126
|
+
- EpProgress
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"category": "feedback",
|
|
4
|
+
"events": [],
|
|
5
|
+
"exampleOmittedReason": null,
|
|
6
|
+
"examples": [
|
|
7
|
+
{
|
|
8
|
+
"code": "<script setup lang=\"ts\">\nimport { EpWatermark } from 'ep-craft'\n</script>\n\n<template>\n <ep-watermark content=\"ep-craft\">\n <div style=\"height: 200px\">需要保护的内容区域</div>\n </ep-watermark>\n</template>",
|
|
9
|
+
"id": "watermark-1",
|
|
10
|
+
"language": "vue",
|
|
11
|
+
"title": "文字水印"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"exposes": [],
|
|
15
|
+
"hot": false,
|
|
16
|
+
"id": "component:watermark",
|
|
17
|
+
"keywords": {
|
|
18
|
+
"en": [
|
|
19
|
+
"watermark",
|
|
20
|
+
"background",
|
|
21
|
+
"feedback"
|
|
22
|
+
],
|
|
23
|
+
"zh": [
|
|
24
|
+
"水印",
|
|
25
|
+
"反馈"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"kind": "component",
|
|
29
|
+
"name": "EpWatermark",
|
|
30
|
+
"nonUseCases": [
|
|
31
|
+
"无需用户感知状态变化时",
|
|
32
|
+
"需要完整业务弹窗流程时优先使用 Dialog"
|
|
33
|
+
],
|
|
34
|
+
"props": [
|
|
35
|
+
{
|
|
36
|
+
"alias": null,
|
|
37
|
+
"defaultText": "9",
|
|
38
|
+
"description": "水印元素的 z-index",
|
|
39
|
+
"hasDefault": true,
|
|
40
|
+
"name": "zIndex",
|
|
41
|
+
"required": false,
|
|
42
|
+
"type": "number"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"alias": null,
|
|
46
|
+
"defaultText": "-22",
|
|
47
|
+
"description": "水印绘制时旋转角度",
|
|
48
|
+
"hasDefault": true,
|
|
49
|
+
"name": "rotate",
|
|
50
|
+
"required": false,
|
|
51
|
+
"type": "number"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"alias": null,
|
|
55
|
+
"defaultText": "120",
|
|
56
|
+
"description": "水印的宽度",
|
|
57
|
+
"hasDefault": false,
|
|
58
|
+
"name": "width",
|
|
59
|
+
"required": false,
|
|
60
|
+
"type": "number"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"alias": null,
|
|
64
|
+
"defaultText": "64",
|
|
65
|
+
"description": "水印的高度",
|
|
66
|
+
"hasDefault": false,
|
|
67
|
+
"name": "height",
|
|
68
|
+
"required": false,
|
|
69
|
+
"type": "number"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"alias": null,
|
|
73
|
+
"defaultText": null,
|
|
74
|
+
"description": "图片源",
|
|
75
|
+
"hasDefault": false,
|
|
76
|
+
"name": "image",
|
|
77
|
+
"required": false,
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"alias": null,
|
|
82
|
+
"defaultText": null,
|
|
83
|
+
"description": "水印文字内容",
|
|
84
|
+
"hasDefault": true,
|
|
85
|
+
"name": "content",
|
|
86
|
+
"required": false,
|
|
87
|
+
"type": "string | string[]"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"alias": null,
|
|
91
|
+
"defaultText": null,
|
|
92
|
+
"description": "文字样式",
|
|
93
|
+
"hasDefault": false,
|
|
94
|
+
"name": "font",
|
|
95
|
+
"required": false,
|
|
96
|
+
"type": "{ color, fontSize, fontWeight, fontFamily, fontStyle, textAlign }"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"alias": null,
|
|
100
|
+
"defaultText": "[100, 100]",
|
|
101
|
+
"description": "水印之间的间距",
|
|
102
|
+
"hasDefault": true,
|
|
103
|
+
"name": "gap",
|
|
104
|
+
"required": false,
|
|
105
|
+
"type": "[number, number]"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"alias": null,
|
|
109
|
+
"defaultText": "[gap[0]/2, gap[1]/2]",
|
|
110
|
+
"description": "水印距离容器左上角的偏移量",
|
|
111
|
+
"hasDefault": false,
|
|
112
|
+
"name": "offset",
|
|
113
|
+
"required": false,
|
|
114
|
+
"type": "[number, number]"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"related": [
|
|
118
|
+
"EpContainer"
|
|
119
|
+
],
|
|
120
|
+
"relations": {
|
|
121
|
+
"children": [],
|
|
122
|
+
"combos": [],
|
|
123
|
+
"parents": [],
|
|
124
|
+
"requiredChildren": []
|
|
125
|
+
},
|
|
126
|
+
"slots": [
|
|
127
|
+
{
|
|
128
|
+
"description": "添加水印的容器",
|
|
129
|
+
"name": "default"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"slug": "watermark",
|
|
133
|
+
"summary": "水印,状态与结果反馈",
|
|
134
|
+
"tag": "ep-watermark",
|
|
135
|
+
"useCases": [
|
|
136
|
+
"展示水印并向用户传达状态",
|
|
137
|
+
"在操作前后提供即时反馈"
|
|
138
|
+
],
|
|
139
|
+
"variants": [],
|
|
140
|
+
"visual": {
|
|
141
|
+
"cssVars": [
|
|
142
|
+
"--el-color-success",
|
|
143
|
+
"--el-color-warning",
|
|
144
|
+
"--el-color-danger",
|
|
145
|
+
"--el-font-size-base"
|
|
146
|
+
],
|
|
147
|
+
"density": "中等",
|
|
148
|
+
"shape": "行内或块级提示",
|
|
149
|
+
"slotContent": [
|
|
150
|
+
"default:添加水印的容器"
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
155
|
+
"libraryVersion": "0.2.0",
|
|
156
|
+
"schemaVersion": 1
|
|
157
|
+
}
|