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,66 @@
|
|
|
1
|
+
# EpWatermark
|
|
2
|
+
|
|
3
|
+
`ep-watermark` · feedback(反馈) · `component:watermark`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
水印,状态与结果反馈
|
|
8
|
+
|
|
9
|
+
## 适用场景
|
|
10
|
+
|
|
11
|
+
- 适用:展示水印并向用户传达状态
|
|
12
|
+
- 适用:在操作前后提供即时反馈
|
|
13
|
+
- 不适用:无需用户感知状态变化时
|
|
14
|
+
- 不适用:需要完整业务弹窗流程时优先使用 Dialog
|
|
15
|
+
|
|
16
|
+
## 关键词
|
|
17
|
+
|
|
18
|
+
- 中文:水印、反馈
|
|
19
|
+
- English: watermark, background, feedback
|
|
20
|
+
|
|
21
|
+
## Props
|
|
22
|
+
|
|
23
|
+
- zIndex (number,默认 9):水印元素的 z-index
|
|
24
|
+
- rotate (number,默认 -22):水印绘制时旋转角度
|
|
25
|
+
- width (number):水印的宽度
|
|
26
|
+
- height (number):水印的高度
|
|
27
|
+
- image (string):图片源
|
|
28
|
+
- content (string | string[],默认 见文档):水印文字内容
|
|
29
|
+
- font ({ color, fontSize, fontWeight, fontFamily, fontStyle, textAlign }):文字样式
|
|
30
|
+
- gap ([number, number],默认 [100, 100]):水印之间的间距
|
|
31
|
+
- offset ([number, number]):水印距离容器左上角的偏移量
|
|
32
|
+
|
|
33
|
+
## Slots
|
|
34
|
+
|
|
35
|
+
- default:添加水印的容器
|
|
36
|
+
|
|
37
|
+
## 视觉提示
|
|
38
|
+
|
|
39
|
+
- 形状:行内或块级提示
|
|
40
|
+
- 密度:中等
|
|
41
|
+
- 插槽内容:default:添加水印的容器
|
|
42
|
+
- CSS 变量:--el-color-success、--el-color-warning、--el-color-danger、--el-font-size-base
|
|
43
|
+
|
|
44
|
+
## 示例
|
|
45
|
+
|
|
46
|
+
### 文字水印
|
|
47
|
+
|
|
48
|
+
```vue
|
|
49
|
+
<script setup lang="ts">
|
|
50
|
+
import { EpWatermark } from 'ep-craft'
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<template>
|
|
54
|
+
<ep-watermark content="ep-craft">
|
|
55
|
+
<div style="height: 200px">需要保护的内容区域</div>
|
|
56
|
+
</ep-watermark>
|
|
57
|
+
</template>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 相关条目
|
|
61
|
+
|
|
62
|
+
- EpContainer
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"bindingForm": "v-click-outside=\"handler\"",
|
|
4
|
+
"category": "interaction",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"依赖 document 上的 mousedown/mouseup 监听,仅在浏览器环境可用",
|
|
7
|
+
"通过 arg 排除触发按钮等元素,避免打开浮层后立即被判定为外部点击",
|
|
8
|
+
"回调在 mouseup 时触发,需要同时判断 mousedown 与 mouseup 的目标"
|
|
9
|
+
],
|
|
10
|
+
"exampleOmittedReason": null,
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { ClickOutside, EpButton } from 'ep-craft'\n\nconst vClickOutside = ClickOutside\nconst open = ref(false)\n\nconst close = () => {\n open.value = false\n}\n</script>\n\n<template>\n <div>\n <ep-button @click=\"open = true\">打开面板</ep-button>\n <div v-if=\"open\" v-click-outside=\"close\" class=\"panel\">点击面板以外区域关闭</div>\n </div>\n</template>",
|
|
14
|
+
"id": "click-outside-1",
|
|
15
|
+
"language": "vue",
|
|
16
|
+
"title": "点击外部关闭"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"exportNames": [
|
|
20
|
+
"ClickOutside"
|
|
21
|
+
],
|
|
22
|
+
"id": "directive:click-outside",
|
|
23
|
+
"keywords": {
|
|
24
|
+
"en": [
|
|
25
|
+
"click-outside",
|
|
26
|
+
"outside-click",
|
|
27
|
+
"dismiss"
|
|
28
|
+
],
|
|
29
|
+
"zh": [
|
|
30
|
+
"点击外部",
|
|
31
|
+
"点击空白",
|
|
32
|
+
"关闭浮层"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"kind": "directive",
|
|
36
|
+
"name": "ClickOutside",
|
|
37
|
+
"options": [
|
|
38
|
+
{
|
|
39
|
+
"defaultText": null,
|
|
40
|
+
"description": "在元素外完成点击时调用",
|
|
41
|
+
"name": "handler",
|
|
42
|
+
"required": true,
|
|
43
|
+
"type": "(mouseup: MouseEvent, mousedown: MouseEvent) => void"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"defaultText": null,
|
|
47
|
+
"description": "排除元素,点击这些元素内部不触发回调",
|
|
48
|
+
"name": "arg",
|
|
49
|
+
"required": false,
|
|
50
|
+
"type": "HTMLElement | HTMLElement[]"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"registrationName": "click-outside",
|
|
54
|
+
"serviceId": null,
|
|
55
|
+
"slug": "click-outside",
|
|
56
|
+
"summary": "点击外部指令,在目标元素外点击时触发回调"
|
|
57
|
+
},
|
|
58
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
59
|
+
"libraryVersion": "0.2.0",
|
|
60
|
+
"schemaVersion": 1
|
|
61
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# ClickOutside
|
|
2
|
+
|
|
3
|
+
`v-click-outside="handler"` · interaction(交互) · `directive:click-outside`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
点击外部指令,在目标元素外点击时触发回调
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:点击外部、点击空白、关闭浮层
|
|
12
|
+
- English: click-outside, outside-click, dismiss
|
|
13
|
+
|
|
14
|
+
## 绑定方式
|
|
15
|
+
|
|
16
|
+
- 绑定形式:v-click-outside="handler"
|
|
17
|
+
- 选项 handler((mouseup: MouseEvent, mousedown: MouseEvent) => void,必填):在元素外完成点击时调用
|
|
18
|
+
- 选项 arg(HTMLElement | HTMLElement[]):排除元素,点击这些元素内部不触发回调
|
|
19
|
+
- 约束:依赖 document 上的 mousedown/mouseup 监听,仅在浏览器环境可用
|
|
20
|
+
- 约束:通过 arg 排除触发按钮等元素,避免打开浮层后立即被判定为外部点击
|
|
21
|
+
- 约束:回调在 mouseup 时触发,需要同时判断 mousedown 与 mouseup 的目标
|
|
22
|
+
|
|
23
|
+
## 示例
|
|
24
|
+
|
|
25
|
+
### 点击外部关闭
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<script setup lang="ts">
|
|
29
|
+
import { ref } from 'vue'
|
|
30
|
+
import { ClickOutside, EpButton } from 'ep-craft'
|
|
31
|
+
|
|
32
|
+
const vClickOutside = ClickOutside
|
|
33
|
+
const open = ref(false)
|
|
34
|
+
|
|
35
|
+
const close = () => {
|
|
36
|
+
open.value = false
|
|
37
|
+
}
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div>
|
|
42
|
+
<ep-button @click="open = true">打开面板</ep-button>
|
|
43
|
+
<div v-if="open" v-click-outside="close" class="panel">点击面板以外区域关闭</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"bindingForm": "v-infinite-scroll=\"load\",可设置 infinite-scroll-distance / delay / disabled / immediate",
|
|
4
|
+
"category": "interaction",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"内容不足一屏时会立即触发回调,必须用 disabled 或加载中状态防止重复请求",
|
|
7
|
+
"只处理向下滚动;向上滚动不会触发加载",
|
|
8
|
+
"目标元素需要处于可滚动容器中才能持续检测到底部"
|
|
9
|
+
],
|
|
10
|
+
"exampleOmittedReason": null,
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { vInfiniteScroll } from 'ep-craft'\n\nconst items = ref(Array.from({ length: 20 }, (_, index) => `条目 ${index + 1}`))\nconst disabled = ref(false)\n\nconst load = () => {\n disabled.value = true\n setTimeout(() => {\n const start = items.value.length\n items.value.push(...Array.from({ length: 10 }, (_, index) => `条目 ${start + index + 1}`))\n disabled.value = false\n }, 300)\n}\n</script>\n\n<template>\n <div\n v-infinite-scroll=\"load\"\n :infinite-scroll-disabled=\"disabled\"\n infinite-scroll-distance=\"20\"\n style=\"height: 240px; overflow: auto\"\n >\n <p v-for=\"item in items\" :key=\"item\">{{ item }}</p>\n </div>\n</template>",
|
|
14
|
+
"id": "infinite-scroll-1",
|
|
15
|
+
"language": "vue",
|
|
16
|
+
"title": "触底加载"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"exportNames": [
|
|
20
|
+
"vInfiniteScroll",
|
|
21
|
+
"EpInfiniteScroll"
|
|
22
|
+
],
|
|
23
|
+
"id": "directive:infinite-scroll",
|
|
24
|
+
"keywords": {
|
|
25
|
+
"en": [
|
|
26
|
+
"infinite-scroll",
|
|
27
|
+
"load-more",
|
|
28
|
+
"scroll"
|
|
29
|
+
],
|
|
30
|
+
"zh": [
|
|
31
|
+
"无限滚动",
|
|
32
|
+
"加载更多",
|
|
33
|
+
"触底"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"kind": "directive",
|
|
37
|
+
"name": "vInfiniteScroll",
|
|
38
|
+
"options": [
|
|
39
|
+
{
|
|
40
|
+
"defaultText": null,
|
|
41
|
+
"description": "接近底部时触发的加载回调",
|
|
42
|
+
"name": "value",
|
|
43
|
+
"required": true,
|
|
44
|
+
"type": "() => void"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"defaultText": "0",
|
|
48
|
+
"description": "距底部多少像素触发,通过 infinite-scroll-distance 设置",
|
|
49
|
+
"name": "distance",
|
|
50
|
+
"required": false,
|
|
51
|
+
"type": "number"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"defaultText": "200",
|
|
55
|
+
"description": "滚动回调的节流毫秒数,通过 infinite-scroll-delay 设置",
|
|
56
|
+
"name": "delay",
|
|
57
|
+
"required": false,
|
|
58
|
+
"type": "number"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"defaultText": "false",
|
|
62
|
+
"description": "是否禁用触发,通过 infinite-scroll-disabled 设置",
|
|
63
|
+
"name": "disabled",
|
|
64
|
+
"required": false,
|
|
65
|
+
"type": "boolean"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"defaultText": "true",
|
|
69
|
+
"description": "挂载时是否立即检查内容高度,通过 infinite-scroll-immediate 设置",
|
|
70
|
+
"name": "immediate",
|
|
71
|
+
"required": false,
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"registrationName": "InfiniteScroll",
|
|
76
|
+
"serviceId": "service:infinite-scroll",
|
|
77
|
+
"slug": "infinite-scroll",
|
|
78
|
+
"summary": "无限滚动指令,接近底部时触发加载更多回调"
|
|
79
|
+
},
|
|
80
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
81
|
+
"libraryVersion": "0.2.0",
|
|
82
|
+
"schemaVersion": 1
|
|
83
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# vInfiniteScroll
|
|
2
|
+
|
|
3
|
+
`v-infinite-scroll="load",可设置 infinite-scroll-distance / delay / disabled / immediate` · interaction(交互) · `directive:infinite-scroll`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
无限滚动指令,接近底部时触发加载更多回调
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:无限滚动、加载更多、触底
|
|
12
|
+
- English: infinite-scroll, load-more, scroll
|
|
13
|
+
|
|
14
|
+
## 绑定方式
|
|
15
|
+
|
|
16
|
+
- 绑定形式:v-infinite-scroll="load",可设置 infinite-scroll-distance / delay / disabled / immediate
|
|
17
|
+
- 选项 value(() => void,必填):接近底部时触发的加载回调
|
|
18
|
+
- 选项 distance(number,默认 0):距底部多少像素触发,通过 infinite-scroll-distance 设置
|
|
19
|
+
- 选项 delay(number,默认 200):滚动回调的节流毫秒数,通过 infinite-scroll-delay 设置
|
|
20
|
+
- 选项 disabled(boolean,默认 false):是否禁用触发,通过 infinite-scroll-disabled 设置
|
|
21
|
+
- 选项 immediate(boolean,默认 true):挂载时是否立即检查内容高度,通过 infinite-scroll-immediate 设置
|
|
22
|
+
- 约束:内容不足一屏时会立即触发回调,必须用 disabled 或加载中状态防止重复请求
|
|
23
|
+
- 约束:只处理向下滚动;向上滚动不会触发加载
|
|
24
|
+
- 约束:目标元素需要处于可滚动容器中才能持续检测到底部
|
|
25
|
+
|
|
26
|
+
## 示例
|
|
27
|
+
|
|
28
|
+
### 触底加载
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { ref } from 'vue'
|
|
33
|
+
import { vInfiniteScroll } from 'ep-craft'
|
|
34
|
+
|
|
35
|
+
const items = ref(Array.from({ length: 20 }, (_, index) => `条目 ${index + 1}`))
|
|
36
|
+
const disabled = ref(false)
|
|
37
|
+
|
|
38
|
+
const load = () => {
|
|
39
|
+
disabled.value = true
|
|
40
|
+
setTimeout(() => {
|
|
41
|
+
const start = items.value.length
|
|
42
|
+
items.value.push(...Array.from({ length: 10 }, (_, index) => `条目 ${start + index + 1}`))
|
|
43
|
+
disabled.value = false
|
|
44
|
+
}, 300)
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div
|
|
50
|
+
v-infinite-scroll="load"
|
|
51
|
+
:infinite-scroll-disabled="disabled"
|
|
52
|
+
infinite-scroll-distance="20"
|
|
53
|
+
style="height: 240px; overflow: auto"
|
|
54
|
+
>
|
|
55
|
+
<p v-for="item in items" :key="item">{{ item }}</p>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"bindingForm": "v-loading=\"loading\" 可配合 fullscreen / lock 修饰符",
|
|
4
|
+
"category": "feedback",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"修饰符 fullscreen 与 lock 分别控制全屏覆盖与滚动锁定",
|
|
7
|
+
"绑定值从 true 变为 false 时移除遮罩,组件卸载时自动清理",
|
|
8
|
+
"页面级异步流程或无法访问模板时改用 EpLoading.service"
|
|
9
|
+
],
|
|
10
|
+
"exampleOmittedReason": null,
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpButton, vLoading } from 'ep-craft'\n\nconst loading = ref(false)\n\nconst load = async () => {\n loading.value = true\n await new Promise((resolve) => setTimeout(resolve, 1000))\n loading.value = false\n}\n</script>\n\n<template>\n <div v-loading=\"loading\" style=\"min-height: 120px\">\n <ep-button @click=\"load\">加载数据</ep-button>\n </div>\n</template>",
|
|
14
|
+
"id": "loading-1",
|
|
15
|
+
"language": "vue",
|
|
16
|
+
"title": "局部加载"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpButton, vLoading } from 'ep-craft'\n\nconst loading = ref(false)\n</script>\n\n<template>\n <ep-button @click=\"loading = !loading\">切换全屏加载</ep-button>\n <div v-loading.fullscreen.lock=\"loading\" />\n</template>",
|
|
20
|
+
"id": "loading-2",
|
|
21
|
+
"language": "vue",
|
|
22
|
+
"title": "全屏加载"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"exportNames": [
|
|
26
|
+
"vLoading"
|
|
27
|
+
],
|
|
28
|
+
"id": "directive:loading",
|
|
29
|
+
"keywords": {
|
|
30
|
+
"en": [
|
|
31
|
+
"loading",
|
|
32
|
+
"spinner",
|
|
33
|
+
"mask",
|
|
34
|
+
"directive"
|
|
35
|
+
],
|
|
36
|
+
"zh": [
|
|
37
|
+
"加载",
|
|
38
|
+
"遮罩",
|
|
39
|
+
"等待"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"kind": "directive",
|
|
43
|
+
"name": "vLoading",
|
|
44
|
+
"options": [
|
|
45
|
+
{
|
|
46
|
+
"defaultText": "false",
|
|
47
|
+
"description": "是否显示加载遮罩",
|
|
48
|
+
"name": "value",
|
|
49
|
+
"required": true,
|
|
50
|
+
"type": "boolean"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"defaultText": "''",
|
|
54
|
+
"description": "加载图标下方的文字",
|
|
55
|
+
"name": "text",
|
|
56
|
+
"required": false,
|
|
57
|
+
"type": "string | VNode | VNode[]"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"defaultText": "false",
|
|
61
|
+
"description": "自定义加载图标类名",
|
|
62
|
+
"name": "spinner",
|
|
63
|
+
"required": false,
|
|
64
|
+
"type": "boolean | string"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"defaultText": null,
|
|
68
|
+
"description": "遮罩背景色",
|
|
69
|
+
"name": "background",
|
|
70
|
+
"required": false,
|
|
71
|
+
"type": "string"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"defaultText": "''",
|
|
75
|
+
"description": "加载遮罩的自定义类名",
|
|
76
|
+
"name": "customClass",
|
|
77
|
+
"required": false,
|
|
78
|
+
"type": "string"
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"registrationName": "loading",
|
|
82
|
+
"serviceId": "service:loading",
|
|
83
|
+
"slug": "loading",
|
|
84
|
+
"summary": "加载指令,在目标元素上显示或移除加载遮罩"
|
|
85
|
+
},
|
|
86
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
87
|
+
"libraryVersion": "0.2.0",
|
|
88
|
+
"schemaVersion": 1
|
|
89
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# vLoading
|
|
2
|
+
|
|
3
|
+
`v-loading="loading" 可配合 fullscreen / lock 修饰符` · feedback(反馈) · `directive:loading`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
加载指令,在目标元素上显示或移除加载遮罩
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:加载、遮罩、等待
|
|
12
|
+
- English: loading, spinner, mask, directive
|
|
13
|
+
|
|
14
|
+
## 绑定方式
|
|
15
|
+
|
|
16
|
+
- 绑定形式:v-loading="loading" 可配合 fullscreen / lock 修饰符
|
|
17
|
+
- 选项 value(boolean,必填,默认 false):是否显示加载遮罩
|
|
18
|
+
- 选项 text(string | VNode | VNode[],默认 ''):加载图标下方的文字
|
|
19
|
+
- 选项 spinner(boolean | string,默认 false):自定义加载图标类名
|
|
20
|
+
- 选项 background(string):遮罩背景色
|
|
21
|
+
- 选项 customClass(string,默认 ''):加载遮罩的自定义类名
|
|
22
|
+
- 约束:修饰符 fullscreen 与 lock 分别控制全屏覆盖与滚动锁定
|
|
23
|
+
- 约束:绑定值从 true 变为 false 时移除遮罩,组件卸载时自动清理
|
|
24
|
+
- 约束:页面级异步流程或无法访问模板时改用 EpLoading.service
|
|
25
|
+
|
|
26
|
+
## 示例
|
|
27
|
+
|
|
28
|
+
### 局部加载
|
|
29
|
+
|
|
30
|
+
```vue
|
|
31
|
+
<script setup lang="ts">
|
|
32
|
+
import { ref } from 'vue'
|
|
33
|
+
import { EpButton, vLoading } from 'ep-craft'
|
|
34
|
+
|
|
35
|
+
const loading = ref(false)
|
|
36
|
+
|
|
37
|
+
const load = async () => {
|
|
38
|
+
loading.value = true
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, 1000))
|
|
40
|
+
loading.value = false
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<div v-loading="loading" style="min-height: 120px">
|
|
46
|
+
<ep-button @click="load">加载数据</ep-button>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 全屏加载
|
|
52
|
+
|
|
53
|
+
```vue
|
|
54
|
+
<script setup lang="ts">
|
|
55
|
+
import { ref } from 'vue'
|
|
56
|
+
import { EpButton, vLoading } from 'ep-craft'
|
|
57
|
+
|
|
58
|
+
const loading = ref(false)
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<template>
|
|
62
|
+
<ep-button @click="loading = !loading">切换全屏加载</ep-button>
|
|
63
|
+
<div v-loading.fullscreen.lock="loading" />
|
|
64
|
+
</template>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"bindingForm": "v-mousewheel=\"handler\"",
|
|
4
|
+
"category": "interaction",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"监听器以 passive 方式注册,回调内不能阻止默认滚动",
|
|
7
|
+
"使用 normalize-wheel-es 归一化不同浏览器的滚轮单位",
|
|
8
|
+
"需要阻止页面滚动时应使用原生事件并自行配置 passive"
|
|
9
|
+
],
|
|
10
|
+
"exampleOmittedReason": null,
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { Mousewheel } from 'ep-craft'\n\nconst vMousewheel = Mousewheel\nconst direction = ref('none')\n\nconst onWheel = (_event: WheelEvent, normalized: { pixelY: number }) => {\n direction.value = normalized.pixelY > 0 ? 'down' : 'up'\n}\n</script>\n\n<template>\n <div v-mousewheel=\"onWheel\" style=\"height: 160px; overflow: auto\">\n <div style=\"height: 600px\">滚轮方向:{{ direction }}</div>\n </div>\n</template>",
|
|
14
|
+
"id": "mousewheel-1",
|
|
15
|
+
"language": "vue",
|
|
16
|
+
"title": "监听滚轮方向"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"exportNames": [
|
|
20
|
+
"Mousewheel"
|
|
21
|
+
],
|
|
22
|
+
"id": "directive:mousewheel",
|
|
23
|
+
"keywords": {
|
|
24
|
+
"en": [
|
|
25
|
+
"mousewheel",
|
|
26
|
+
"wheel",
|
|
27
|
+
"scroll"
|
|
28
|
+
],
|
|
29
|
+
"zh": [
|
|
30
|
+
"滚轮",
|
|
31
|
+
"鼠标滚轮",
|
|
32
|
+
"滚动方向"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"kind": "directive",
|
|
36
|
+
"name": "Mousewheel",
|
|
37
|
+
"options": [
|
|
38
|
+
{
|
|
39
|
+
"defaultText": null,
|
|
40
|
+
"description": "滚轮事件回调,normalized 提供统一的方向与像素位移",
|
|
41
|
+
"name": "handler",
|
|
42
|
+
"required": true,
|
|
43
|
+
"type": "(event: WheelEvent, normalized: NormalizedWheelEvent) => void"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"registrationName": "mousewheel",
|
|
47
|
+
"serviceId": null,
|
|
48
|
+
"slug": "mousewheel",
|
|
49
|
+
"summary": "滚轮指令,监听滚轮并返回归一化方向与位移"
|
|
50
|
+
},
|
|
51
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
52
|
+
"libraryVersion": "0.2.0",
|
|
53
|
+
"schemaVersion": 1
|
|
54
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Mousewheel
|
|
2
|
+
|
|
3
|
+
`v-mousewheel="handler"` · interaction(交互) · `directive:mousewheel`
|
|
4
|
+
|
|
5
|
+
## 摘要
|
|
6
|
+
|
|
7
|
+
滚轮指令,监听滚轮并返回归一化方向与位移
|
|
8
|
+
|
|
9
|
+
## 关键词
|
|
10
|
+
|
|
11
|
+
- 中文:滚轮、鼠标滚轮、滚动方向
|
|
12
|
+
- English: mousewheel, wheel, scroll
|
|
13
|
+
|
|
14
|
+
## 绑定方式
|
|
15
|
+
|
|
16
|
+
- 绑定形式:v-mousewheel="handler"
|
|
17
|
+
- 选项 handler((event: WheelEvent, normalized: NormalizedWheelEvent) => void,必填):滚轮事件回调,normalized 提供统一的方向与像素位移
|
|
18
|
+
- 约束:监听器以 passive 方式注册,回调内不能阻止默认滚动
|
|
19
|
+
- 约束:使用 normalize-wheel-es 归一化不同浏览器的滚轮单位
|
|
20
|
+
- 约束:需要阻止页面滚动时应使用原生事件并自行配置 passive
|
|
21
|
+
|
|
22
|
+
## 示例
|
|
23
|
+
|
|
24
|
+
### 监听滚轮方向
|
|
25
|
+
|
|
26
|
+
```vue
|
|
27
|
+
<script setup lang="ts">
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
import { Mousewheel } from 'ep-craft'
|
|
30
|
+
|
|
31
|
+
const vMousewheel = Mousewheel
|
|
32
|
+
const direction = ref('none')
|
|
33
|
+
|
|
34
|
+
const onWheel = (_event: WheelEvent, normalized: { pixelY: number }) => {
|
|
35
|
+
direction.value = normalized.pixelY > 0 ? 'down' : 'up'
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div v-mousewheel="onWheel" style="height: 160px; overflow: auto">
|
|
41
|
+
<div style="height: 600px">滚轮方向:{{ direction }}</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
ep-craft 0.2.0
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"bindingForm": "v-repeat-click=\"handler\" 或 v-repeat-click=\"{ handler, interval, delay }\"",
|
|
4
|
+
"category": "interaction",
|
|
5
|
+
"constraints": [
|
|
6
|
+
"只响应鼠标左键;触摸与键盘事件不会触发",
|
|
7
|
+
"回调在按下时立即执行一次,之后按 delay 与 interval 重复",
|
|
8
|
+
"需要防抖或禁用时由业务侧控制,指令本身不提供 disabled 选项"
|
|
9
|
+
],
|
|
10
|
+
"exampleOmittedReason": null,
|
|
11
|
+
"examples": [
|
|
12
|
+
{
|
|
13
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { EpButton, vRepeatClick } from 'ep-craft'\n\nconst count = ref(0)\n\nconst increase = () => {\n count.value += 1\n}\n</script>\n\n<template>\n <ep-button v-repeat-click=\"{ handler: increase, delay: 600, interval: 100 }\">\n 按住连续增加:{{ count }}\n </ep-button>\n</template>",
|
|
14
|
+
"id": "repeat-click-1",
|
|
15
|
+
"language": "vue",
|
|
16
|
+
"title": "长按连续触发"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"exportNames": [
|
|
20
|
+
"vRepeatClick"
|
|
21
|
+
],
|
|
22
|
+
"id": "directive:repeat-click",
|
|
23
|
+
"keywords": {
|
|
24
|
+
"en": [
|
|
25
|
+
"repeat-click",
|
|
26
|
+
"long-press",
|
|
27
|
+
"hold"
|
|
28
|
+
],
|
|
29
|
+
"zh": [
|
|
30
|
+
"长按",
|
|
31
|
+
"重复点击",
|
|
32
|
+
"连发"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"kind": "directive",
|
|
36
|
+
"name": "vRepeatClick",
|
|
37
|
+
"options": [
|
|
38
|
+
{
|
|
39
|
+
"defaultText": null,
|
|
40
|
+
"description": "首次按下与重复触发时调用的函数",
|
|
41
|
+
"name": "handler",
|
|
42
|
+
"required": true,
|
|
43
|
+
"type": "(...args: unknown[]) => unknown"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"defaultText": "100",
|
|
47
|
+
"description": "重复触发的间隔毫秒数",
|
|
48
|
+
"name": "interval",
|
|
49
|
+
"required": false,
|
|
50
|
+
"type": "number"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"defaultText": "600",
|
|
54
|
+
"description": "首次触发后进入重复模式前的等待毫秒数",
|
|
55
|
+
"name": "delay",
|
|
56
|
+
"required": false,
|
|
57
|
+
"type": "number"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"registrationName": "repeat-click",
|
|
61
|
+
"serviceId": null,
|
|
62
|
+
"slug": "repeat-click",
|
|
63
|
+
"summary": "长按重复点击指令,按住后按间隔持续触发"
|
|
64
|
+
},
|
|
65
|
+
"generatedAt": "2026-11-03T03:09:12.050Z",
|
|
66
|
+
"libraryVersion": "0.2.0",
|
|
67
|
+
"schemaVersion": 1
|
|
68
|
+
}
|