king-design-analyzer 2.2.0 → 2.2.2
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/components/actions.json +8 -0
- package/components/advancedset.json +1 -0
- package/components/affix.json +1 -0
- package/components/anchor.json +220 -0
- package/components/anchorlink.json +111 -0
- package/components/badge.json +1 -0
- package/components/breadcrumb.json +2 -1
- package/components/button.json +1 -0
- package/components/buttonlink.json +1 -0
- package/components/card.json +6 -3
- package/components/cardcontent.json +5 -0
- package/components/cascader.json +56 -0
- package/components/collapse.json +335 -348
- package/components/configprovider.json +96 -0
- package/components/copyrow.json +1 -0
- package/components/descriptions.json +10 -3
- package/components/diagram.json +295 -0
- package/components/dialog.json +4 -0
- package/components/divider.json +1 -0
- package/components/drawer.json +32 -0
- package/components/dropdown.json +13 -4
- package/components/flex.json +1 -0
- package/components/form.json +12 -3
- package/components/header.json +4 -0
- package/components/input.json +8 -4
- package/components/layoutcontent.json +9 -0
- package/components/layoutlistcontent.json +9 -0
- package/components/layoutpermissioncontent.json +1 -0
- package/components/layoutstandardlist.json +1 -0
- package/components/lazymount.json +1 -0
- package/components/lazyteleport.json +1 -0
- package/components/menu.json +4 -3
- package/components/notification.json +351 -0
- package/components/popover.json +23 -0
- package/components/protable.json +2 -0
- package/components/rate.json +1 -0
- package/components/scrollselect.json +140 -0
- package/components/select.json +72 -0
- package/components/skeleton.json +1 -0
- package/components/slider.json +12 -2
- package/components/spin.json +2 -1
- package/components/spinner.json +422 -428
- package/components/split.json +3 -0
- package/components/switch.json +4 -2
- package/components/table.json +6 -1
- package/components/tabs.json +2 -2
- package/components/tag.json +8 -5
- package/components/timeline.json +3 -1
- package/components/tip.json +20 -0
- package/components/tooltip.json +8 -0
- package/components/tour.json +16 -0
- package/components/transfer.json +52 -5
- package/components/tree.json +22 -1
- package/components/treeselect.json +56 -0
- package/components/upload.json +16 -0
- package/components/vdialog.json +1 -0
- package/components/vdrawer.json +4 -0
- package/components/virtuallist.json +9 -0
- package/dist/ast/index.d.mts +30 -1
- package/dist/ast/index.d.ts +30 -1
- package/dist/ast/index.js +3 -3
- package/dist/ast/index.mjs +1 -1
- package/dist/{chunk-BI5TIQID.mjs → chunk-4OTQAQ6J.mjs} +13 -2
- package/dist/chunk-6HOIRUQB.mjs +409 -0
- package/dist/{chunk-XGPHQHLR.mjs → chunk-BSCASJTV.mjs} +27 -4
- package/dist/{chunk-CR3GC4H3.js → chunk-DHLWNT53.js} +13 -2
- package/dist/{chunk-CJGGFVQJ.js → chunk-HARQRI4F.js} +31 -8
- package/dist/{chunk-TA3SV4SP.js → chunk-JJ6AB4ZH.js} +2 -2
- package/dist/{chunk-3LYQ5XFM.mjs → chunk-NZL6T22V.mjs} +1 -1
- package/dist/chunk-V5N65MRP.js +411 -0
- package/dist/{chunk-SZYVGYKK.js → chunk-XPHDD6XR.js} +113 -35
- package/dist/{chunk-KMIDURUR.mjs → chunk-YRGYDK2I.mjs} +113 -35
- package/dist/full/index.d.mts +2 -0
- package/dist/full/index.d.ts +2 -0
- package/dist/full/index.js +6 -6
- package/dist/full/index.mjs +4 -4
- package/dist/index.js +13 -13
- package/dist/index.mjs +5 -5
- package/dist/metadata/index.d.mts +17 -2
- package/dist/metadata/index.d.ts +17 -2
- package/dist/runtime/index.d.mts +2 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/index.mjs +2 -2
- package/dist/static/index.js +5 -5
- package/dist/static/index.mjs +2 -2
- package/docs_for_llm/actions.doc.md +11 -1
- package/docs_for_llm/advancedset.doc.md +10 -1
- package/docs_for_llm/affix.doc.md +5 -0
- package/docs_for_llm/anchor.doc.md +155 -0
- package/docs_for_llm/anchorlink.doc.md +75 -0
- package/docs_for_llm/badge.doc.md +5 -0
- package/docs_for_llm/breadcrumb.doc.md +74 -1
- package/docs_for_llm/button.doc.md +57 -0
- package/docs_for_llm/buttonlink.doc.md +10 -1
- package/docs_for_llm/card.doc.md +50 -3
- package/docs_for_llm/cardcontent.doc.md +21 -0
- package/docs_for_llm/carousel.doc.md +71 -0
- package/docs_for_llm/cascader.doc.md +62 -0
- package/docs_for_llm/collapse.doc.md +138 -8
- package/docs_for_llm/configprovider.doc.md +77 -0
- package/docs_for_llm/copyrow.doc.md +10 -1
- package/docs_for_llm/datepicker.doc.md +19 -0
- package/docs_for_llm/descriptions.doc.md +113 -4
- package/docs_for_llm/diagram.doc.md +343 -0
- package/docs_for_llm/dialog.doc.md +49 -0
- package/docs_for_llm/divider.doc.md +5 -0
- package/docs_for_llm/drawer.doc.md +86 -0
- package/docs_for_llm/dropdown.doc.md +257 -3
- package/docs_for_llm/flex.doc.md +10 -1
- package/docs_for_llm/form.doc.md +163 -4
- package/docs_for_llm/formitemspinner.doc.md +1 -1
- package/docs_for_llm/grid.doc.md +71 -0
- package/docs_for_llm/header.doc.md +33 -4
- package/docs_for_llm/input.doc.md +109 -2
- package/docs_for_llm/layoutcontent.doc.md +37 -0
- package/docs_for_llm/layoutlistcontent.doc.md +82 -9
- package/docs_for_llm/layoutpermissioncontent.doc.md +10 -1
- package/docs_for_llm/layoutstandardlist.doc.md +10 -1
- package/docs_for_llm/lazymount.doc.md +10 -1
- package/docs_for_llm/lazyteleport.doc.md +10 -1
- package/docs_for_llm/menu.doc.md +125 -3
- package/docs_for_llm/message.doc.md +45 -0
- package/docs_for_llm/notification.doc.md +214 -0
- package/docs_for_llm/popover.doc.md +34 -0
- package/docs_for_llm/protable.doc.md +9 -0
- package/docs_for_llm/rate.doc.md +5 -0
- package/docs_for_llm/scrollselect.doc.md +90 -0
- package/docs_for_llm/select.doc.md +189 -0
- package/docs_for_llm/skeleton.doc.md +35 -0
- package/docs_for_llm/slider.doc.md +11 -1
- package/docs_for_llm/spin.doc.md +10 -1
- package/docs_for_llm/spinner.doc.md +1 -1
- package/docs_for_llm/split.doc.md +13 -0
- package/docs_for_llm/steps.doc.md +71 -0
- package/docs_for_llm/switch.doc.md +15 -2
- package/docs_for_llm/table.doc.md +199 -4
- package/docs_for_llm/tabs.doc.md +98 -2
- package/docs_for_llm/tag.doc.md +148 -5
- package/docs_for_llm/timeline.doc.md +80 -2
- package/docs_for_llm/timepicker.doc.md +19 -0
- package/docs_for_llm/tip.doc.md +30 -0
- package/docs_for_llm/tooltip.doc.md +46 -0
- package/docs_for_llm/tour.doc.md +102 -0
- package/docs_for_llm/transfer.doc.md +59 -4
- package/docs_for_llm/tree.doc.md +64 -1
- package/docs_for_llm/treeselect.doc.md +68 -0
- package/docs_for_llm/upload.doc.md +28 -0
- package/docs_for_llm/vdialog.doc.md +26 -1
- package/docs_for_llm/vdrawer.doc.md +33 -4
- package/docs_for_llm/virtuallist.doc.md +165 -0
- package/package.json +3 -3
- package/dist/chunk-D2SXGGTX.mjs +0 -162
- package/dist/chunk-EYKZY2F3.js +0 -164
|
@@ -16,17 +16,95 @@ import { Timeline, TimelineItem } from '@king-design/vue';
|
|
|
16
16
|
| --- | --- | --- | --- |
|
|
17
17
|
| default | 时间轴内容,通常由多个 TimelineItem 组成。 | `<Timeline>...</Timeline>` | `<Timeline><TimelineItem>创建完成</TimelineItem><TimelineItem>审核通过</TimelineItem></Timeline>` |
|
|
18
18
|
|
|
19
|
+
### 插槽参数说明
|
|
20
|
+
**default**
|
|
21
|
+
|
|
22
|
+
- 参数结构: 无参数
|
|
23
|
+
|
|
19
24
|
## 子组件 (Sub-Components)
|
|
20
25
|
### TimelineItem
|
|
21
26
|
时间轴节点项。
|
|
22
27
|
|
|
28
|
+
#### 属性 (Props)
|
|
23
29
|
| 属性名 | 类型 | 说明 | 示例 |
|
|
24
30
|
| --- | --- | --- | --- |
|
|
25
31
|
| type | `"primary" | "warning" | "danger" | "success"` | 节点状态类型。 | `<TimelineItem type="success">发布成功</TimelineItem>` |
|
|
26
32
|
| size | `"large" | "default" | "small" | "mini"` | 节点尺寸。 | `<TimelineItem size="small">日志记录</TimelineItem>` |
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
#### 插槽 (Slots)
|
|
35
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
36
|
+
| --- | --- | --- | --- |
|
|
37
|
+
| dot | 自定义时间轴节点圆点。 | `<template #dot>...</template>` | `<TimelineItem><template #dot><Icon class="k-icon-check" /></template>发布完成</TimelineItem>` |
|
|
38
|
+
|
|
39
|
+
##### 插槽参数说明
|
|
40
|
+
**dot**
|
|
41
|
+
|
|
42
|
+
- 参数结构: 无参数
|
|
43
|
+
|
|
44
|
+
#### 组合示例
|
|
45
|
+
##### 自定义节点
|
|
46
|
+
**场景**: 用图标增强时间轴状态表达
|
|
47
|
+
|
|
48
|
+
通过 dot 插槽渲染图标或编号。
|
|
49
|
+
|
|
50
|
+
**命中的子组件 API**: 属性: type | 插槽: dot
|
|
51
|
+
|
|
52
|
+
```vue
|
|
53
|
+
<script setup lang="ts">
|
|
54
|
+
import { Icon, Timeline, TimelineItem } from '@king-design/vue';
|
|
55
|
+
</script>
|
|
56
|
+
<template>
|
|
57
|
+
<Timeline>
|
|
58
|
+
<TimelineItem>
|
|
59
|
+
<template #dot>
|
|
60
|
+
<Icon class="k-icon-play-circle" />
|
|
61
|
+
</template>
|
|
62
|
+
服务启动
|
|
63
|
+
</TimelineItem>
|
|
64
|
+
<TimelineItem type="success">
|
|
65
|
+
<template #dot>
|
|
66
|
+
<Icon class="k-icon-check" />
|
|
67
|
+
</template>
|
|
68
|
+
健康检查通过
|
|
69
|
+
</TimelineItem>
|
|
70
|
+
</Timeline>
|
|
71
|
+
</template>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
##### 不同状态节点
|
|
75
|
+
**场景**: 用时间轴展示状态变更
|
|
76
|
+
|
|
77
|
+
用颜色区分不同阶段。
|
|
78
|
+
|
|
79
|
+
**命中的子组件 API**: 属性: type
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<template>
|
|
83
|
+
<Timeline>
|
|
84
|
+
<TimelineItem type="primary">等待执行</TimelineItem>
|
|
85
|
+
<TimelineItem type="warning">处理中</TimelineItem>
|
|
86
|
+
<TimelineItem type="danger">执行失败</TimelineItem>
|
|
87
|
+
<TimelineItem type="success">重新执行成功</TimelineItem>
|
|
88
|
+
</Timeline>
|
|
89
|
+
</template>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
##### 基础用法
|
|
93
|
+
**场景**: 展示任务处理过程
|
|
94
|
+
|
|
95
|
+
按时间顺序展示操作记录。
|
|
96
|
+
|
|
97
|
+
**命中的子组件 API**: 属性: type
|
|
98
|
+
|
|
99
|
+
```vue
|
|
100
|
+
<template>
|
|
101
|
+
<Timeline>
|
|
102
|
+
<TimelineItem>2026-04-20 10:00 创建任务</TimelineItem>
|
|
103
|
+
<TimelineItem>2026-04-20 10:10 分配负责人</TimelineItem>
|
|
104
|
+
<TimelineItem type="success">2026-04-20 10:30 处理完成</TimelineItem>
|
|
105
|
+
</Timeline>
|
|
106
|
+
</template>
|
|
107
|
+
```
|
|
30
108
|
|
|
31
109
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
32
110
|
### 在 Timeline 中直接写普通 div,而不是 TimelineItem
|
|
@@ -86,6 +86,25 @@ const handleSelecting = (value, confirmed) => {
|
|
|
86
86
|
| hide | 主动关闭时间选择面板。 | `-` | `void` |
|
|
87
87
|
| position | 重新计算时间选择面板的位置。 | `-` | `void` |
|
|
88
88
|
|
|
89
|
+
### 方法调用示例
|
|
90
|
+
**show**
|
|
91
|
+
|
|
92
|
+
```typescript
|
|
93
|
+
timepickerRef.value?.show();
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**hide**
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
timepickerRef.value?.hide();
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**position**
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
timepickerRef.value?.position();
|
|
106
|
+
```
|
|
107
|
+
|
|
89
108
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
90
109
|
### 范围选择时 value 类型错误
|
|
91
110
|
> **错误用法**: `const time = ref('');
|
package/docs_for_llm/tip.doc.md
CHANGED
|
@@ -41,6 +41,36 @@ const handleClose = (e: MouseEvent) => {
|
|
|
41
41
|
};
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
+
## 插槽 (Slots)
|
|
45
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
46
|
+
| --- | --- | --- | --- |
|
|
47
|
+
| title | 自定义标题内容 | `<template #title>...</template>` | `<Tip>
|
|
48
|
+
<template <template #title>...</template>>自定义标题</template>
|
|
49
|
+
</Tip>` |
|
|
50
|
+
| close | 自定义关闭按钮内容 | `<template #close>...</template>` | `<Tip>
|
|
51
|
+
<template <template #close>...</template>>
|
|
52
|
+
自定义close内容
|
|
53
|
+
</template>
|
|
54
|
+
</Tip>` |
|
|
55
|
+
| icon | 自定义Icon内容 | `<template #icon>...</template>` | `<Tip>
|
|
56
|
+
<template <template #icon>...</template>>
|
|
57
|
+
自定义icon内容
|
|
58
|
+
</template>
|
|
59
|
+
</Tip>` |
|
|
60
|
+
|
|
61
|
+
### 插槽参数说明
|
|
62
|
+
**title**
|
|
63
|
+
|
|
64
|
+
- 参数结构: 无参数
|
|
65
|
+
|
|
66
|
+
**close**
|
|
67
|
+
|
|
68
|
+
- 参数结构: 无参数
|
|
69
|
+
|
|
70
|
+
**icon**
|
|
71
|
+
|
|
72
|
+
- 参数结构: 无参数
|
|
73
|
+
|
|
44
74
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
45
75
|
### 使用 closable 但未处理关闭逻辑
|
|
46
76
|
> **错误用法**: `<Tip closable>提示</Tip> <!-- 点击关闭按钮不会隐藏 -->`
|
|
@@ -50,6 +50,18 @@ const handlePositioned = (feedback: Feedback) => {
|
|
|
50
50
|
};
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
## 插槽 (Slots)
|
|
54
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| content | 自定义提示内容 | `<template #content>...</template>` | `<Tooltip>
|
|
57
|
+
<template <template #content>...</template>>自定义内容</template>
|
|
58
|
+
</Tooltip>` |
|
|
59
|
+
|
|
60
|
+
### 插槽参数说明
|
|
61
|
+
**content**
|
|
62
|
+
|
|
63
|
+
- 参数结构: 无参数
|
|
64
|
+
|
|
53
65
|
## 方法 (Methods)
|
|
54
66
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
55
67
|
| --- | --- | --- | --- |
|
|
@@ -64,18 +76,52 @@ const handlePositioned = (feedback: Feedback) => {
|
|
|
64
76
|
| --- | --- | --- | --- | --- |
|
|
65
77
|
| shouldFocus | `boolean` | 否 | - | 显示后是否尝试把焦点移动到弹层内容。 |
|
|
66
78
|
|
|
79
|
+
调用示例:
|
|
80
|
+
```typescript
|
|
81
|
+
tooltipRef.value?.show(true);
|
|
82
|
+
```
|
|
83
|
+
|
|
67
84
|
**hide**
|
|
68
85
|
|
|
69
86
|
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
70
87
|
| --- | --- | --- | --- | --- |
|
|
71
88
|
| immediately | `boolean` | 是 | - | 是否立即隐藏,用于手动控制点击确认型 Tooltip 的关闭时机。 |
|
|
72
89
|
|
|
90
|
+
调用示例:
|
|
91
|
+
```typescript
|
|
92
|
+
tooltipRef.value?.hide(true);
|
|
93
|
+
```
|
|
94
|
+
|
|
73
95
|
**position**
|
|
74
96
|
|
|
75
97
|
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
76
98
|
| --- | --- | --- | --- | --- |
|
|
77
99
|
| callback | `(feedback: Feedback) => void` | 否 | - | 定位完成后的回调,可读取最终 placement 和坐标。 |
|
|
78
100
|
|
|
101
|
+
调用示例:
|
|
102
|
+
```typescript
|
|
103
|
+
tooltipRef.value?.position((feedback) => console.log(feedback.placement));
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 方法调用示例
|
|
107
|
+
**show**
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
tooltipRef.value?.show(true);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**hide**
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
tooltipRef.value?.hide(true);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**position**
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
tooltipRef.value?.position((feedback) => console.log(feedback.placement));
|
|
123
|
+
```
|
|
124
|
+
|
|
79
125
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
80
126
|
### 未提供触发元素
|
|
81
127
|
> **错误用法**: `<Tooltip content="提示" />`
|
package/docs_for_llm/tour.doc.md
CHANGED
|
@@ -76,6 +76,7 @@ const handlePositioned = (feedback: Feedback) => {
|
|
|
76
76
|
### TourStep
|
|
77
77
|
引导步骤组件,用于定义每个引导步骤的内容
|
|
78
78
|
|
|
79
|
+
#### 属性 (Props)
|
|
79
80
|
| 属性名 | 类型 | 说明 | 示例 |
|
|
80
81
|
| --- | --- | --- | --- |
|
|
81
82
|
| target | `string | HTMLElement` | 目标元素,可以是 CSS 选择器或 DOM 元素。不指定则居中显示 | `<TourStep target="#btn1">` |
|
|
@@ -85,6 +86,107 @@ const handlePositioned = (feedback: Feedback) => {
|
|
|
85
86
|
| nextText | `string` | 下一步按钮文本 | `<TourStep nextText="继续">` |
|
|
86
87
|
| prevText | `string` | 上一步按钮文本 | `<TourStep prevText="返回">` |
|
|
87
88
|
|
|
89
|
+
#### 插槽 (Slots)
|
|
90
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
91
|
+
| --- | --- | --- | --- |
|
|
92
|
+
| header | 自定义步骤头部内容,可覆盖标题区域。 | `#header` | `<TourStep>
|
|
93
|
+
<template #header>
|
|
94
|
+
<strong>欢迎使用控制台</strong>
|
|
95
|
+
</template>
|
|
96
|
+
</TourStep>` |
|
|
97
|
+
| footer | 自定义步骤底部操作区,可覆盖默认的步骤指示和按钮。 | `#footer` | `<TourStep>
|
|
98
|
+
<template #footer>
|
|
99
|
+
<Button size="small">跳过引导</Button>
|
|
100
|
+
<Button type="primary" size="small">继续</Button>
|
|
101
|
+
</template>
|
|
102
|
+
</TourStep>` |
|
|
103
|
+
|
|
104
|
+
##### 插槽参数说明
|
|
105
|
+
**header**
|
|
106
|
+
|
|
107
|
+
- 参数结构: 无参数
|
|
108
|
+
|
|
109
|
+
**footer**
|
|
110
|
+
|
|
111
|
+
- 参数结构: 无参数
|
|
112
|
+
|
|
113
|
+
#### 组合示例
|
|
114
|
+
##### 声明式步骤
|
|
115
|
+
**场景**: 使用声明式方式定义引导步骤
|
|
116
|
+
|
|
117
|
+
使用 TourStep 子组件定义步骤
|
|
118
|
+
|
|
119
|
+
**命中的子组件 API**: 属性: target, title, content, position
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<script setup lang="ts">
|
|
123
|
+
import { ref } from 'vue';
|
|
124
|
+
import { Tour, TourStep, Button } from '@king-design/vue';
|
|
125
|
+
|
|
126
|
+
const currentStep = ref(0);
|
|
127
|
+
const showTour = ref(false);
|
|
128
|
+
|
|
129
|
+
const startTour = () => {
|
|
130
|
+
showTour.value = true;
|
|
131
|
+
currentStep.value = 0;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const closeTour = () => {
|
|
135
|
+
showTour.value = false;
|
|
136
|
+
};
|
|
137
|
+
</script>
|
|
138
|
+
<template>
|
|
139
|
+
<div>
|
|
140
|
+
<Button id="btn1">元素1</Button>
|
|
141
|
+
<Button id="btn2" style="margin-left: 20px;">元素2</Button>
|
|
142
|
+
<Tour v-model="currentStep" :visible="showTour" @finish="closeTour">
|
|
143
|
+
<TourStep target="#btn1" title="第一步" content="第一步说明" position="left" />
|
|
144
|
+
<TourStep target="#btn2" title="第二步" position="top">第二步说明</TourStep>
|
|
145
|
+
</Tour>
|
|
146
|
+
<Button @click="startTour">启动引导</Button>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
##### 居中引导
|
|
152
|
+
**场景**: 无目标元素的居中显示引导
|
|
153
|
+
|
|
154
|
+
无目标元素的居中显示
|
|
155
|
+
|
|
156
|
+
**命中的子组件 API**: 属性: title
|
|
157
|
+
|
|
158
|
+
```vue
|
|
159
|
+
<script setup lang="ts">
|
|
160
|
+
import { ref } from 'vue';
|
|
161
|
+
import { Tour, TourStep, Button } from '@king-design/vue';
|
|
162
|
+
|
|
163
|
+
const currentStep = ref(0);
|
|
164
|
+
const showTour = ref(false);
|
|
165
|
+
|
|
166
|
+
const startTour = () => {
|
|
167
|
+
showTour.value = true;
|
|
168
|
+
currentStep.value = 0;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const closeTour = () => {
|
|
172
|
+
showTour.value = false;
|
|
173
|
+
};
|
|
174
|
+
</script>
|
|
175
|
+
<template>
|
|
176
|
+
<div>
|
|
177
|
+
<Tour v-model="currentStep" :visible="showTour" @finish="closeTour">
|
|
178
|
+
<TourStep title="欢迎页面">
|
|
179
|
+
<span>没有指定目标元素时,引导弹窗会居中显示。</span>
|
|
180
|
+
</TourStep>
|
|
181
|
+
<TourStep title="功能介绍">
|
|
182
|
+
<span>适合用于展示全局性的引导说明。</span>
|
|
183
|
+
</TourStep>
|
|
184
|
+
</Tour>
|
|
185
|
+
<Button @click="startTour">启动无目标引导</Button>
|
|
186
|
+
</div>
|
|
187
|
+
</template>
|
|
188
|
+
```
|
|
189
|
+
|
|
88
190
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
89
191
|
### target 选择器未匹配到元素
|
|
90
192
|
> **错误用法**: `<TourStep target="btn1" /> <!-- 缺少 # -->`
|
|
@@ -55,10 +55,47 @@ const handlePage = (model: 'left' | 'right', data: { value: number; limit: numbe
|
|
|
55
55
|
## 插槽 (Slots)
|
|
56
56
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
57
57
|
| --- | --- | --- | --- |
|
|
58
|
-
| header | 自定义整个头部内容 | `
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
| header | 自定义整个头部内容 | `#header="type"` | `<Transfer :data="data">
|
|
59
|
+
<template #header="type">
|
|
60
|
+
<span>{{ type === 'left' ? '待选列表' : '已选列表' }}</span>
|
|
61
|
+
</template>
|
|
62
|
+
</Transfer>` |
|
|
63
|
+
| filter | 自定义检索内容 | `#filter="type"` | `<Transfer :data="data">
|
|
64
|
+
<template #filter="type">
|
|
65
|
+
<span>{{ type === 'left' ? '搜索左侧' : '搜索右侧' }}</span>
|
|
66
|
+
</template>
|
|
67
|
+
</Transfer>` |
|
|
68
|
+
| list | 自定义整个列表内容 | `#list="type"` | `<Transfer :data="data">
|
|
69
|
+
<template #list="type">
|
|
70
|
+
<div>当前面板: {{ type }}</div>
|
|
71
|
+
</template>
|
|
72
|
+
</Transfer>` |
|
|
73
|
+
| label | 自定义每一项的渲染函数,类似于 label 属性 | `#label="[data, key, type]"` | `<Transfer :data="data">
|
|
74
|
+
<template #label="[data, key, type]">
|
|
75
|
+
<span>{{ data.label }} - {{ type }} - {{ key }}</span>
|
|
76
|
+
</template>
|
|
77
|
+
</Transfer>` |
|
|
78
|
+
|
|
79
|
+
### 插槽参数说明
|
|
80
|
+
**header**
|
|
81
|
+
|
|
82
|
+
- 参数结构: #header="type"
|
|
83
|
+
- 参数列表: `type: 'left' | 'right'`
|
|
84
|
+
|
|
85
|
+
**filter**
|
|
86
|
+
|
|
87
|
+
- 参数结构: #filter="type"
|
|
88
|
+
- 参数列表: `type: 'left' | 'right'`
|
|
89
|
+
|
|
90
|
+
**list**
|
|
91
|
+
|
|
92
|
+
- 参数结构: #list="type"
|
|
93
|
+
- 参数列表: `type: 'left' | 'right'`
|
|
94
|
+
|
|
95
|
+
**label**
|
|
96
|
+
|
|
97
|
+
- 参数结构: #label="[data, key, type]"
|
|
98
|
+
- 参数列表: `data: TransferDataItem`、`key: string | number`、`type: 'left' | 'right'`
|
|
62
99
|
|
|
63
100
|
## 方法 (Methods)
|
|
64
101
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
@@ -73,6 +110,24 @@ const handlePage = (model: 'left' | 'right', data: { value: number; limit: numbe
|
|
|
73
110
|
| --- | --- | --- | --- | --- |
|
|
74
111
|
| model | `'left' | 'right'` | 是 | - | 指定读取左侧候选列表或右侧已选列表中的勾选数据。 |
|
|
75
112
|
|
|
113
|
+
调用示例:
|
|
114
|
+
```typescript
|
|
115
|
+
const leftChecked = transferRef.value?.getCheckedData('left');
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 方法调用示例
|
|
119
|
+
**getData**
|
|
120
|
+
|
|
121
|
+
```typescript
|
|
122
|
+
const rightData = transferRef.value?.getData();
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**getCheckedData**
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
const leftChecked = transferRef.value?.getCheckedData('left');
|
|
129
|
+
```
|
|
130
|
+
|
|
76
131
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
77
132
|
### data 中缺少 key 属性
|
|
78
133
|
> **错误用法**: `const data = [{ label: '选项1' }]; // 缺少 key`
|
package/docs_for_llm/tree.doc.md
CHANGED
|
@@ -68,7 +68,18 @@ const handleDragEnd = (data) => {
|
|
|
68
68
|
## 插槽 (Slots)
|
|
69
69
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
70
70
|
| --- | --- | --- | --- |
|
|
71
|
-
| label | 自定义节点渲染内容 | `
|
|
71
|
+
| label | 自定义节点渲染内容 | `#label="[data, node, index]"` | `<Tree :data="treeData">
|
|
72
|
+
<template #label="[data, node]">
|
|
73
|
+
<span>{{ data.label }}</span>
|
|
74
|
+
<em v-if="node.isLeaf">叶子</em>
|
|
75
|
+
</template>
|
|
76
|
+
</Tree>` |
|
|
77
|
+
|
|
78
|
+
### 插槽参数说明
|
|
79
|
+
**label**
|
|
80
|
+
|
|
81
|
+
- 参数结构: #label="[data, node, index]"
|
|
82
|
+
- 参数列表: `data: TreeDataItem`、`node: TreeNode`、`index: number`
|
|
72
83
|
|
|
73
84
|
## 方法 (Methods)
|
|
74
85
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
@@ -87,18 +98,70 @@ const handleDragEnd = (data) => {
|
|
|
87
98
|
| --- | --- | --- | --- | --- |
|
|
88
99
|
| leafOnly | `boolean` | 否 | `false` | 是否只返回叶子节点;传 `true` 时会过滤掉父级节点。 |
|
|
89
100
|
|
|
101
|
+
调用示例:
|
|
102
|
+
```typescript
|
|
103
|
+
const checkedData = treeRef.value?.getCheckedData();
|
|
104
|
+
```
|
|
105
|
+
|
|
90
106
|
**expand**
|
|
91
107
|
|
|
92
108
|
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
93
109
|
| --- | --- | --- | --- | --- |
|
|
94
110
|
| key | `K` | 是 | - | 要展开的节点 key |
|
|
95
111
|
|
|
112
|
+
调用示例:
|
|
113
|
+
```typescript
|
|
114
|
+
treeRef.value?.expand('node1');
|
|
115
|
+
```
|
|
116
|
+
|
|
96
117
|
**shrink**
|
|
97
118
|
|
|
98
119
|
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
99
120
|
| --- | --- | --- | --- | --- |
|
|
100
121
|
| key | `K` | 是 | - | 要收起的节点 key |
|
|
101
122
|
|
|
123
|
+
调用示例:
|
|
124
|
+
```typescript
|
|
125
|
+
treeRef.value?.shrink('node1');
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 方法调用示例
|
|
129
|
+
**getCheckedData**
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
const checkedData = treeRef.value?.getCheckedData();
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**getSelectedData**
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
const selectedData = treeRef.value?.getSelectedData();
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**expand**
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
treeRef.value?.expand('node1');
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**shrink**
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
treeRef.value?.shrink('node1');
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**expandAll**
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
treeRef.value?.expandAll();
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**getNodes**
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
const nodes = treeRef.value?.getNodes();
|
|
163
|
+
```
|
|
164
|
+
|
|
102
165
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
103
166
|
### data 中缺少 key 属性
|
|
104
167
|
> **错误用法**: `const data = [{ label: '节点1' }]; // 缺少 key`
|
|
@@ -48,6 +48,49 @@ import { TreeSelect } from '@king-design/vue';
|
|
|
48
48
|
| show | `@show` | 菜单弹出时触发 | `-` | `<TreeSelect @show="handleShow">` |
|
|
49
49
|
| hide | `@hide` | 菜单隐藏时触发 | `-` | `<TreeSelect @hide="handleHide">` |
|
|
50
50
|
|
|
51
|
+
## 插槽 (Slots)
|
|
52
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| value | 自定义单选模式下的已选值展示内容 | `#value="[value, label]"` | `<TreeSelect v-model="value" :data="treeData">
|
|
55
|
+
<template #value="[value, label]">
|
|
56
|
+
<span>{{ label }} ({{ value }})</span>
|
|
57
|
+
</template>
|
|
58
|
+
</TreeSelect>` |
|
|
59
|
+
| values | 自定义多选模式下的已选值展示内容 | `#values="[values, labels]"` | `<TreeSelect v-model="values" :data="treeData" multiple>
|
|
60
|
+
<template #values="[values, labels]">
|
|
61
|
+
<span>已选 {{ labels.length }} 项</span>
|
|
62
|
+
</template>
|
|
63
|
+
</TreeSelect>` |
|
|
64
|
+
| prefix | 扩展选择框前缀内容 | `#prefix` | `<TreeSelect :data="treeData">
|
|
65
|
+
<template #prefix>
|
|
66
|
+
<span class="k-icon-search"></span>
|
|
67
|
+
</template>
|
|
68
|
+
</TreeSelect>` |
|
|
69
|
+
| suffix | 扩展选择框后缀内容 | `#suffix` | `<TreeSelect :data="treeData">
|
|
70
|
+
<template #suffix>
|
|
71
|
+
<span class="suffix-tip">树</span>
|
|
72
|
+
</template>
|
|
73
|
+
</TreeSelect>` |
|
|
74
|
+
|
|
75
|
+
### 插槽参数说明
|
|
76
|
+
**value**
|
|
77
|
+
|
|
78
|
+
- 参数结构: #value="[value, label]"
|
|
79
|
+
- 参数列表: `value: K`、`label: string`
|
|
80
|
+
|
|
81
|
+
**values**
|
|
82
|
+
|
|
83
|
+
- 参数结构: #values="[values, labels]"
|
|
84
|
+
- 参数列表: `values: K[]`、`labels: string[]`
|
|
85
|
+
|
|
86
|
+
**prefix**
|
|
87
|
+
|
|
88
|
+
- 参数结构: 无参数
|
|
89
|
+
|
|
90
|
+
**suffix**
|
|
91
|
+
|
|
92
|
+
- 参数结构: 无参数
|
|
93
|
+
|
|
51
94
|
## 方法 (Methods)
|
|
52
95
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
53
96
|
| --- | --- | --- | --- |
|
|
@@ -56,6 +99,31 @@ import { TreeSelect } from '@king-design/vue';
|
|
|
56
99
|
| position | 重新计算下拉树面板的位置。 | `-` | `void` |
|
|
57
100
|
| expandAll | 展开所有节点 | `-` | `void` |
|
|
58
101
|
|
|
102
|
+
### 方法调用示例
|
|
103
|
+
**show**
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
treeSelectRef.value?.show();
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**hide**
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
treeSelectRef.value?.hide();
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**position**
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
treeSelectRef.value?.position();
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**expandAll**
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
treeSelectRef.value?.expandAll();
|
|
125
|
+
```
|
|
126
|
+
|
|
59
127
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
60
128
|
### data 中缺少 key 属性
|
|
61
129
|
> **错误用法**: `const data = [{ label: '节点1' }]; // 缺少 key`
|
|
@@ -87,11 +87,39 @@ const handleError = (err, file, files) => {
|
|
|
87
87
|
};
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
## 插槽 (Slots)
|
|
91
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
92
|
+
| --- | --- | --- | --- |
|
|
93
|
+
| content | 自定义上传触发区域内容,例如按钮、拖拽提示文案等。 | `<template #content>...</template>` | `<Upload action="/api/upload">
|
|
94
|
+
<template #content>
|
|
95
|
+
<Button type="primary">选择文件</Button>
|
|
96
|
+
</template>
|
|
97
|
+
</Upload>` |
|
|
98
|
+
| tip | 自定义底部提示内容,通常用于说明支持的文件类型、大小或数量限制。 | `<template #tip>...</template>` | `<Upload action="/api/upload">
|
|
99
|
+
<template #tip>只能上传 JPG/PNG 文件,且不超过 500KB</template>
|
|
100
|
+
</Upload>` |
|
|
101
|
+
|
|
102
|
+
### 插槽参数说明
|
|
103
|
+
**content**
|
|
104
|
+
|
|
105
|
+
- 参数结构: 无参数
|
|
106
|
+
|
|
107
|
+
**tip**
|
|
108
|
+
|
|
109
|
+
- 参数结构: 无参数
|
|
110
|
+
|
|
90
111
|
## 方法 (Methods)
|
|
91
112
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
92
113
|
| --- | --- | --- | --- |
|
|
93
114
|
| submit | 手动上传时,调用该方法开始上传 | `-` | `void` |
|
|
94
115
|
|
|
116
|
+
### 方法调用示例
|
|
117
|
+
**submit**
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
uploadRef.value?.submit();
|
|
121
|
+
```
|
|
122
|
+
|
|
95
123
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
96
124
|
### 未设置 action 属性
|
|
97
125
|
> **错误用法**: `<Upload /> <!-- 缺少上传地址 -->`
|
|
@@ -68,7 +68,32 @@ import { VDialog } from '@ksyun-internal/versatile';
|
|
|
68
68
|
<!-- 完全自定义弹窗结构 -->
|
|
69
69
|
</template>
|
|
70
70
|
</Dialog>` |
|
|
71
|
-
| trigger | 自定义触发按钮或触发区域 | `<template #trigger>...</template>` |
|
|
71
|
+
| trigger | 自定义触发按钮或触发区域 | `<template #trigger>...</template>` | `<VDialog>
|
|
72
|
+
<template <template #trigger>...</template>>
|
|
73
|
+
自定义trigger内容
|
|
74
|
+
</template>
|
|
75
|
+
</VDialog>` |
|
|
76
|
+
|
|
77
|
+
### 插槽参数说明
|
|
78
|
+
**default**
|
|
79
|
+
|
|
80
|
+
- 参数结构: 无参数
|
|
81
|
+
|
|
82
|
+
**header**
|
|
83
|
+
|
|
84
|
+
- 参数结构: 无参数
|
|
85
|
+
|
|
86
|
+
**footer**
|
|
87
|
+
|
|
88
|
+
- 参数结构: 无参数
|
|
89
|
+
|
|
90
|
+
**content**
|
|
91
|
+
|
|
92
|
+
- 参数结构: 无参数
|
|
93
|
+
|
|
94
|
+
**trigger**
|
|
95
|
+
|
|
96
|
+
- 参数结构: 无参数
|
|
72
97
|
|
|
73
98
|
## 使用示例
|
|
74
99
|
### 受控表单弹窗
|