king-design-analyzer 2.1.7 → 2.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/components/actions.json +101 -0
- package/components/advancedset.json +127 -0
- package/components/affix.json +7 -0
- package/components/aksk.json +172 -0
- package/components/az.json +15 -2
- package/components/badge.json +7 -0
- package/components/billtypes.json +14 -2
- package/components/breadcrumb.json +7 -0
- package/components/button.json +191 -0
- package/components/buttonlink.json +73 -0
- package/components/card.json +8 -1
- package/components/cardcol.json +142 -0
- package/components/cardcols.json +121 -0
- package/components/cardcontent.json +15 -3
- package/components/cardtabs.json +172 -0
- package/components/carousel.json +7 -0
- package/components/cascader.json +520 -368
- package/components/checkbox.json +51 -4
- package/components/cidrinput.json +140 -0
- package/components/code.json +8 -1
- package/components/collapse.json +7 -0
- package/components/colorpicker.json +217 -0
- package/components/copy.json +7 -0
- package/components/copyhover.json +111 -0
- package/components/copyrow.json +124 -0
- package/components/datepicker.json +656 -524
- package/components/description.json +98 -0
- package/components/dialog.json +522 -455
- package/components/divider.json +8 -1
- package/components/drawer.json +571 -558
- package/components/dropdown.json +464 -384
- package/components/duration.json +125 -0
- package/components/editable.json +66 -0
- package/components/ellipsis.json +34 -1
- package/components/filtertablefieldsdialog.json +128 -0
- package/components/flex.json +151 -0
- package/components/form.json +131 -0
- package/components/formiteminput.json +214 -0
- package/components/formitemspinner.json +213 -0
- package/components/formitemswitch.json +185 -0
- package/components/formitemtableconfigs.json +210 -0
- package/components/grid.json +7 -0
- package/components/header.json +161 -0
- package/components/icon.json +13 -1
- package/components/icontooltip.json +19 -1
- package/components/input.json +188 -4
- package/components/instancelist.json +194 -0
- package/components/instancenum.json +196 -0
- package/components/ipinput.json +117 -0
- package/components/kspstatus.json +205 -0
- package/components/kvcode.json +120 -0
- package/components/layoutcontent.json +15 -3
- package/components/layoutlistcontent.json +148 -0
- package/components/layoutpermissioncontent.json +155 -0
- package/components/layoutstandardlist.json +275 -0
- package/components/layouttabs.json +168 -0
- package/components/lazymount.json +86 -0
- package/components/lazyteleport.json +118 -0
- package/components/menu.json +7 -0
- package/components/pagination.json +12 -0
- package/components/paginationplus.json +30 -3
- package/components/password.json +121 -0
- package/components/popover.json +457 -437
- package/components/projects.json +129 -0
- package/components/protable.json +97 -8
- package/components/queuevisualrange.json +110 -0
- package/components/radio.json +82 -2
- package/components/rate.json +199 -0
- package/components/region.json +14 -2
- package/components/search.json +221 -0
- package/components/searchinput.json +132 -0
- package/components/searchitems.json +215 -0
- package/components/searchselect.json +195 -0
- package/components/select.json +686 -666
- package/components/sidebar.json +198 -0
- package/components/skeleton.json +233 -0
- package/components/spin.json +8 -1
- package/components/split.json +260 -0
- package/components/sshkeys.json +138 -0
- package/components/status.json +60 -3
- package/components/steps.json +7 -0
- package/components/switch.json +8 -1
- package/components/table.json +18 -1
- package/components/tablecolumnid.json +14 -2
- package/components/tabs.json +12 -0
- package/components/timeline.json +213 -0
- package/components/timepicker.json +147 -3
- package/components/timerange.json +262 -0
- package/components/tip.json +7 -0
- package/components/tooltip.json +484 -395
- package/components/tour.json +418 -372
- package/components/transfer.json +27 -3
- package/components/tree.json +6 -4
- package/components/treeselect.json +556 -475
- package/components/upload.json +474 -473
- package/components/vdialog.json +308 -0
- package/components/vdrawer.json +331 -0
- package/components/virtuallist.json +7 -0
- package/dist/ast/index.d.mts +35 -1
- package/dist/ast/index.d.ts +35 -1
- package/dist/ast/index.js +5 -3
- package/dist/ast/index.mjs +3 -1
- package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
- package/dist/chunk-BI5TIQID.mjs +330 -0
- package/dist/{chunk-6QS5IGS6.js → chunk-CJGGFVQJ.js} +8 -8
- package/dist/chunk-CR3GC4H3.js +353 -0
- package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
- package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
- package/dist/chunk-JSBRDJBE.js +30 -0
- package/dist/chunk-KF5YBEM5.js +143 -0
- package/dist/chunk-KMIDURUR.mjs +33324 -0
- package/dist/chunk-QC6VTSA3.mjs +117 -0
- package/dist/chunk-SZYVGYKK.js +33350 -0
- package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
- package/dist/chunk-UJCSKKID.mjs +27 -0
- package/dist/{chunk-FVSQ6BU6.mjs → chunk-XGPHQHLR.mjs} +4 -4
- package/dist/docs/index.js +1 -1
- package/dist/docs/index.mjs +1 -1
- package/dist/full/index.js +8 -6
- package/dist/full/index.mjs +6 -4
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -13
- package/dist/index.mjs +7 -5
- package/dist/metadata/index.d.mts +22 -2
- package/dist/metadata/index.d.ts +22 -2
- package/dist/metadata/index.js +27 -17
- package/dist/metadata/index.mjs +27 -16
- package/dist/resolve-BsLBxlBi.d.mts +24 -0
- package/dist/resolve-BsLBxlBi.d.ts +24 -0
- package/dist/runtime/index.js +5 -4
- package/dist/runtime/index.mjs +3 -2
- package/dist/shared/index.d.mts +10 -0
- package/dist/shared/index.d.ts +10 -0
- package/dist/shared/index.js +23 -0
- package/dist/shared/index.mjs +2 -0
- package/dist/static/index.js +6 -5
- package/dist/static/index.mjs +3 -2
- package/docs_for_llm/actions.doc.md +77 -0
- package/docs_for_llm/advancedset.doc.md +89 -0
- package/docs_for_llm/affix.doc.md +15 -7
- package/docs_for_llm/aksk.doc.md +111 -0
- package/docs_for_llm/az.doc.md +17 -11
- package/docs_for_llm/badge.doc.md +6 -5
- package/docs_for_llm/billtypes.doc.md +17 -11
- package/docs_for_llm/breadcrumb.doc.md +6 -3
- package/docs_for_llm/button.doc.md +34 -18
- package/docs_for_llm/buttonlink.doc.md +55 -0
- package/docs_for_llm/card.doc.md +8 -5
- package/docs_for_llm/cardcol.doc.md +78 -0
- package/docs_for_llm/cardcols.doc.md +84 -0
- package/docs_for_llm/cardcontent.doc.md +10 -10
- package/docs_for_llm/cardtabs.doc.md +106 -0
- package/docs_for_llm/carousel.doc.md +8 -7
- package/docs_for_llm/cascader.doc.md +46 -25
- package/docs_for_llm/checkbox.doc.md +25 -13
- package/docs_for_llm/cidrinput.doc.md +83 -0
- package/docs_for_llm/code.doc.md +22 -11
- package/docs_for_llm/collapse.doc.md +9 -6
- package/docs_for_llm/colorpicker.doc.md +104 -0
- package/docs_for_llm/copy.doc.md +15 -13
- package/docs_for_llm/copyhover.doc.md +59 -0
- package/docs_for_llm/copyrow.doc.md +71 -0
- package/docs_for_llm/datepicker.doc.md +51 -39
- package/docs_for_llm/description.doc.md +75 -0
- package/docs_for_llm/descriptions.doc.md +9 -6
- package/docs_for_llm/dialog.doc.md +48 -77
- package/docs_for_llm/divider.doc.md +9 -7
- package/docs_for_llm/drawer.doc.md +43 -84
- package/docs_for_llm/dropdown.doc.md +52 -21
- package/docs_for_llm/duration.doc.md +76 -0
- package/docs_for_llm/editable.doc.md +36 -14
- package/docs_for_llm/ellipsis.doc.md +10 -5
- package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
- package/docs_for_llm/flex.doc.md +74 -0
- package/docs_for_llm/form.doc.md +33 -14
- package/docs_for_llm/formiteminput.doc.md +128 -0
- package/docs_for_llm/formitemspinner.doc.md +105 -0
- package/docs_for_llm/formitemswitch.doc.md +113 -0
- package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
- package/docs_for_llm/grid.doc.md +7 -5
- package/docs_for_llm/header.doc.md +85 -0
- package/docs_for_llm/icon.doc.md +12 -8
- package/docs_for_llm/icontooltip.doc.md +121 -0
- package/docs_for_llm/input.doc.md +90 -39
- package/docs_for_llm/instancelist.doc.md +113 -0
- package/docs_for_llm/instancenum.doc.md +95 -0
- package/docs_for_llm/ipinput.doc.md +77 -0
- package/docs_for_llm/kspstatus.doc.md +82 -0
- package/docs_for_llm/kvcode.doc.md +76 -0
- package/docs_for_llm/layoutcontent.doc.md +17 -17
- package/docs_for_llm/layoutlistcontent.doc.md +95 -0
- package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
- package/docs_for_llm/layoutstandardlist.doc.md +120 -0
- package/docs_for_llm/layouttabs.doc.md +101 -0
- package/docs_for_llm/lazymount.doc.md +73 -0
- package/docs_for_llm/lazyteleport.doc.md +76 -0
- package/docs_for_llm/menu.doc.md +14 -11
- package/docs_for_llm/message.doc.md +48 -10
- package/docs_for_llm/pagination.doc.md +30 -17
- package/docs_for_llm/paginationplus.doc.md +31 -10
- package/docs_for_llm/password.doc.md +86 -0
- package/docs_for_llm/popover.doc.md +24 -55
- package/docs_for_llm/progress.doc.md +13 -10
- package/docs_for_llm/projects.doc.md +91 -0
- package/docs_for_llm/protable.doc.md +89 -15
- package/docs_for_llm/queuevisualrange.doc.md +78 -0
- package/docs_for_llm/radio.doc.md +23 -8
- package/docs_for_llm/rate.doc.md +122 -0
- package/docs_for_llm/region.doc.md +25 -13
- package/docs_for_llm/search.doc.md +120 -0
- package/docs_for_llm/searchinput.doc.md +111 -0
- package/docs_for_llm/searchitems.doc.md +116 -0
- package/docs_for_llm/searchselect.doc.md +126 -0
- package/docs_for_llm/select.doc.md +40 -55
- package/docs_for_llm/sidebar.doc.md +133 -0
- package/docs_for_llm/skeleton.doc.md +117 -0
- package/docs_for_llm/slider.doc.md +31 -21
- package/docs_for_llm/spin.doc.md +8 -5
- package/docs_for_llm/spinner.doc.md +28 -18
- package/docs_for_llm/split.doc.md +157 -0
- package/docs_for_llm/sshkeys.doc.md +88 -0
- package/docs_for_llm/status.doc.md +14 -9
- package/docs_for_llm/steps.doc.md +10 -7
- package/docs_for_llm/switch.doc.md +17 -14
- package/docs_for_llm/table.doc.md +118 -51
- package/docs_for_llm/tablecolumnid.doc.md +36 -16
- package/docs_for_llm/tabs.doc.md +19 -10
- package/docs_for_llm/tag.doc.md +19 -10
- package/docs_for_llm/timeline.doc.md +109 -0
- package/docs_for_llm/timepicker.doc.md +57 -38
- package/docs_for_llm/timerange.doc.md +157 -0
- package/docs_for_llm/tip.doc.md +20 -11
- package/docs_for_llm/tooltip.doc.md +55 -29
- package/docs_for_llm/tour.doc.md +48 -29
- package/docs_for_llm/transfer.doc.md +40 -29
- package/docs_for_llm/tree.doc.md +65 -23
- package/docs_for_llm/treeselect.doc.md +37 -48
- package/docs_for_llm/upload.doc.md +56 -32
- package/docs_for_llm/useCRUD.doc.md +49 -0
- package/docs_for_llm/useCountdown.doc.md +43 -0
- package/docs_for_llm/useDetail.doc.md +48 -0
- package/docs_for_llm/useDialog.doc.md +46 -0
- package/docs_for_llm/useEntity.doc.md +45 -0
- package/docs_for_llm/useEventListener.doc.md +44 -0
- package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
- package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
- package/docs_for_llm/useGetUserPermission.doc.md +43 -0
- package/docs_for_llm/useGroup.doc.md +48 -0
- package/docs_for_llm/useIdEntities.doc.md +48 -0
- package/docs_for_llm/useIdEntity.doc.md +103 -0
- package/docs_for_llm/useInterval.doc.md +43 -0
- package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
- package/docs_for_llm/useMessage.doc.md +46 -0
- package/docs_for_llm/useModifyCache.doc.md +37 -0
- package/docs_for_llm/useOpenDialog.doc.md +41 -0
- package/docs_for_llm/usePagination.doc.md +60 -0
- package/docs_for_llm/usePersist.doc.md +54 -0
- package/docs_for_llm/usePoll.doc.md +41 -0
- package/docs_for_llm/useRoutePlus.doc.md +34 -0
- package/docs_for_llm/useRouterPlus.doc.md +34 -0
- package/docs_for_llm/useSearch.doc.md +68 -0
- package/docs_for_llm/useShell.doc.md +43 -0
- package/docs_for_llm/useSkip.doc.md +41 -0
- package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
- package/docs_for_llm/useStore.doc.md +34 -0
- package/docs_for_llm/useTable.doc.md +57 -0
- package/docs_for_llm/useTableGroup.doc.md +47 -0
- package/docs_for_llm/useTableSort.doc.md +40 -0
- package/docs_for_llm/useToState.doc.md +112 -0
- package/docs_for_llm/useUser.doc.md +38 -0
- package/docs_for_llm/useValidForm.doc.md +41 -0
- package/docs_for_llm/vdialog.doc.md +129 -0
- package/docs_for_llm/vdrawer.doc.md +119 -0
- package/docs_for_llm/virtuallist.doc.md +6 -3
- package/hooks/useCRUD.json +61 -0
- package/hooks/useCountdown.json +49 -0
- package/hooks/useDetail.json +67 -0
- package/hooks/useDialog.json +49 -0
- package/hooks/useEntity.json +61 -0
- package/hooks/useEventListener.json +61 -0
- package/hooks/useFalseUntilTruthy.json +43 -0
- package/hooks/useGetCopyAuthText.json +36 -0
- package/hooks/useGetUserPermission.json +55 -0
- package/hooks/useGroup.json +49 -0
- package/hooks/useIdEntities.json +61 -0
- package/hooks/useInterval.json +55 -0
- package/hooks/useLayoutStandardList.json +36 -0
- package/hooks/useMessage.json +73 -0
- package/hooks/useModifyCache.json +36 -0
- package/hooks/useOpenDialog.json +43 -0
- package/hooks/usePagination.json +49 -0
- package/hooks/usePersist.json +61 -0
- package/hooks/usePoll.json +43 -0
- package/hooks/useRoutePlus.json +36 -0
- package/hooks/useRouterPlus.json +36 -0
- package/hooks/useSearch.json +56 -0
- package/hooks/useShell.json +49 -0
- package/hooks/useSkip.json +43 -0
- package/hooks/useStorageIdEntity.json +67 -0
- package/hooks/useStore.json +36 -0
- package/hooks/useTable.json +49 -0
- package/hooks/useTableGroup.json +43 -0
- package/hooks/useTableSort.json +43 -0
- package/hooks/useUser.json +36 -0
- package/hooks/useValidForm.json +43 -0
- package/package.json +12 -6
- package/dist/chunk-HDV7ETXE.mjs +0 -1055
- package/dist/chunk-HPAUCD5I.js +0 -156
- package/dist/chunk-L4DS3EXI.mjs +0 -133
- package/dist/chunk-YWY3D4J7.js +0 -1082
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# 操作按钮集 (Actions)
|
|
2
|
+
|
|
3
|
+
用于组织主操作和次操作的按钮集合组件,常放在表格操作列、详情页头部和工具栏右侧,避免页面出现过多平铺按钮。
|
|
4
|
+
|
|
5
|
+
**关键词**: actions, action buttons, 操作按钮集, 更多操作, 主次操作, 操作列按钮
|
|
6
|
+
|
|
7
|
+
**使用场景**: 表格操作列、页面头部操作区、主次操作分层展示
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| primaries | `ActionConfig[]` | `[]` | 否 | 一级操作按钮列表 | - | - |
|
|
18
|
+
| secondaries | `ActionConfig[]` | `[]` | 否 | 二级操作按钮列表,通常展示在“更多”菜单中 | - | - |
|
|
19
|
+
|
|
20
|
+
## 插槽 (Slots)
|
|
21
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
22
|
+
| --- | --- | --- | --- |
|
|
23
|
+
| btnText | 自定义按钮文案渲染 | `<template #btnText="{ action }">...</template>` | - |
|
|
24
|
+
|
|
25
|
+
## 使用示例
|
|
26
|
+
### 表格操作列中的主次操作
|
|
27
|
+
**场景**: 在列表行内同时承载高频与低频操作,减少操作列拥挤。
|
|
28
|
+
|
|
29
|
+
将高频操作直接展示,低频操作折叠到更多菜单中。
|
|
30
|
+
|
|
31
|
+
**使用的 API**: 属性: primaries, secondaries
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
36
|
+
|
|
37
|
+
const primaries = [
|
|
38
|
+
{ text: '重启', type: 'primary', onClick: () => console.log('restart') },
|
|
39
|
+
];
|
|
40
|
+
const secondaries = [
|
|
41
|
+
{ text: '续费', onClick: () => console.log('renew') },
|
|
42
|
+
{ text: '释放', danger: true, onClick: () => console.log('delete') },
|
|
43
|
+
];
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<Actions :primaries="primaries" :secondaries="secondaries" />
|
|
48
|
+
</template>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 自定义操作按钮文案
|
|
52
|
+
**场景**: 在操作区给危险动作补充更明确的文案提示。
|
|
53
|
+
|
|
54
|
+
使用 btnText 插槽为危险操作补充风险提示。
|
|
55
|
+
|
|
56
|
+
**使用的 API**: 属性: primaries, secondaries
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { Actions } from '@ksyun-internal/versatile';
|
|
61
|
+
|
|
62
|
+
const primaries = [{ text: '启动', onClick: () => console.log('start') }];
|
|
63
|
+
const secondaries = [{ text: '释放', danger: true, onClick: () => console.log('release') }];
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<template>
|
|
67
|
+
<Actions :primaries="primaries" :secondaries="secondaries">
|
|
68
|
+
<template #btnText="{ action }">
|
|
69
|
+
{{ action.danger ? action.text + '(高风险)' : action.text }}
|
|
70
|
+
</template>
|
|
71
|
+
</Actions>
|
|
72
|
+
</template>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## 相关组件
|
|
76
|
+
ButtonLink, IconTooltip
|
|
77
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 高级设置开关 (AdvancedSet)
|
|
2
|
+
|
|
3
|
+
用于折叠和展开高级配置区域的业务组件,适合购买页、创建页中把非高频参数收进“高级设置”。
|
|
4
|
+
|
|
5
|
+
**关键词**: advanced set, advanced options, 高级设置, 折叠配置区, 高级参数
|
|
6
|
+
|
|
7
|
+
**使用场景**: 高级参数开关、可折叠配置区、编辑页默认展开高级设置
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { AdvancedSet } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `boolean` | `undefined` | 否 | 是否展开高级设置 | - | - |
|
|
18
|
+
| label | `string` | `undefined` | 否 | 标题文案 | - | - |
|
|
19
|
+
| appendTip | `string` | `undefined` | 否 | 追加提示文案 | - | - |
|
|
20
|
+
|
|
21
|
+
## 事件 (Events)
|
|
22
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| update:modelValue | `@update:modelValue` | 用户展开或收起高级设置区域时触发,可用于同步表单状态或埋点。 | `value?: boolean` | - |
|
|
25
|
+
|
|
26
|
+
### 事件参数说明
|
|
27
|
+
**update:modelValue**
|
|
28
|
+
|
|
29
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
30
|
+
| --- | --- | --- | --- | --- |
|
|
31
|
+
| value | `boolean` | 否 | - | 当前高级设置区域的展开状态。 |
|
|
32
|
+
|
|
33
|
+
## 插槽 (Slots)
|
|
34
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| default | 高级设置内容区域 | `<AdvancedSet>...</AdvancedSet>` | - |
|
|
37
|
+
|
|
38
|
+
## 使用示例
|
|
39
|
+
### 购买页中的高级设置折叠区
|
|
40
|
+
**场景**: 创建实例时把网络、命名等低频参数收纳到高级设置区。
|
|
41
|
+
|
|
42
|
+
默认收起高级参数,只在用户主动展开后展示额外配置。
|
|
43
|
+
|
|
44
|
+
**使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
|
|
45
|
+
|
|
46
|
+
```vue
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import { ref } from 'vue';
|
|
49
|
+
import { AdvancedSet, FormItemInput, FormItemSpinner } from '@ksyun-internal/versatile';
|
|
50
|
+
|
|
51
|
+
const advanced = ref(false);
|
|
52
|
+
const hostname = ref('web-01');
|
|
53
|
+
const bandwidth = ref(20);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后将影响实例网络配置">
|
|
58
|
+
<FormItemInput v-model="hostname" label="主机名" />
|
|
59
|
+
<FormItemSpinner v-model="bandwidth" label="带宽峰值" unit="Mbps" />
|
|
60
|
+
</AdvancedSet>
|
|
61
|
+
</template>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 默认展开高级设置
|
|
65
|
+
**场景**: 在编辑页面中默认展开高级参数,方便用户快速核对设置。
|
|
66
|
+
|
|
67
|
+
在编辑已有配置时直接展开高级区域,减少额外点击。
|
|
68
|
+
|
|
69
|
+
**使用的 API**: 属性: modelValue, label, appendTip | 事件: update:modelValue
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<script setup lang="ts">
|
|
73
|
+
import { ref } from 'vue';
|
|
74
|
+
import { AdvancedSet, FormItemSwitch } from '@ksyun-internal/versatile';
|
|
75
|
+
|
|
76
|
+
const advanced = ref(true);
|
|
77
|
+
const enableMonitor = ref(false);
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<template>
|
|
81
|
+
<AdvancedSet v-model="advanced" label="高级设置" append-tip="修改后即时生效">
|
|
82
|
+
<FormItemSwitch v-model="enableMonitor" label="开启监控增强" />
|
|
83
|
+
</AdvancedSet>
|
|
84
|
+
</template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 相关组件
|
|
88
|
+
FormItemInput, FormItemSpinner
|
|
89
|
+
|
|
@@ -12,25 +12,33 @@ import { Affix } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | `<Affix :top="100"></Affix>` |
|
|
18
|
-
| bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | `<Affix :bottom="50"></Affix>` |
|
|
19
|
-
| shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | `<Affix :shouldFix="checkFix"></Affix>` |
|
|
20
|
-
| exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | `<Affix :exclude="checkExclude"></Affix>` |
|
|
21
|
-
| disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | `<Affix disabled></Affix>` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| top | `number` | `undefined` | 否 | 距离窗口顶部的偏移量,设置为 undefined 则不生效 | - | `<Affix :top="100"></Affix>` |
|
|
18
|
+
| bottom | `number` | `undefined` | 否 | 距离窗口底部的偏移量,设置为 undefined 则不生效 | - | `<Affix :bottom="50"></Affix>` |
|
|
19
|
+
| shouldFix | `Function` | `undefined` | 否 | 自定义是否需要固定的函数,返回 boolean | - | `<Affix :shouldFix="checkFix"></Affix>` |
|
|
20
|
+
| exclude | `Function` | `undefined` | 否 | 自定义排除固定的函数,返回 boolean 表示不固定 | - | `<Affix :exclude="checkExclude"></Affix>` |
|
|
21
|
+
| disabled | `boolean` | `false` | 否 | 是否禁用固定功能 | - | `<Affix disabled></Affix>` |
|
|
22
22
|
|
|
23
23
|
## 事件 (Events)
|
|
24
24
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
25
|
| --- | --- | --- | --- | --- |
|
|
26
26
|
| change | `@change` | 固定状态改变时触发 | `isFixed: boolean` | `<Affix @change="handleChange"></Affix>` |
|
|
27
27
|
|
|
28
|
+
### 事件参数说明
|
|
29
|
+
**change**
|
|
30
|
+
|
|
31
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| isFixed | `boolean` | 是 | - | 当前是否处于固定状态 |
|
|
34
|
+
|
|
28
35
|
## 插槽 (Slots)
|
|
29
36
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
30
37
|
| --- | --- | --- | --- |
|
|
31
38
|
| default | 需要被固定的元素 | `#default` | `<Affix><Button>Fixed Button</Button></Affix>` |
|
|
32
39
|
|
|
33
40
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
41
|
+
### 父容器滚动问题
|
|
34
42
|
> **错误用法**: `<div style="overflow: auto; height: 200px;">
|
|
35
43
|
<Affix :top="10">...</Affix>
|
|
36
44
|
</div>`
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# AK/SK 配置 (AKSK)
|
|
2
|
+
|
|
3
|
+
用于录入 AccessKey / SecretKey 并控制是否沿用原始凭证的业务表单组件,常见于任务同步、数据接入和跨账号授权场景。
|
|
4
|
+
|
|
5
|
+
**关键词**: aksk, access key, secret key, 凭证配置, ak sk, 云服务凭证
|
|
6
|
+
|
|
7
|
+
**使用场景**: 云服务凭证录入、数据集或任务凭证配置、切换原始凭证或自定义凭证
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { AKSK } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 属性 (Props)
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| ak | `string | null` | `undefined` | 否 | 当前 AccessKey | - | - |
|
|
18
|
+
| sk | `string | null` | `undefined` | 否 | 当前 SecretKey | - | - |
|
|
19
|
+
| isUseOriginal | `boolean | null` | `false` | 否 | 是否使用原始 AK/SK | - | - |
|
|
20
|
+
| isShowUseOriginal | `boolean | null` | `false` | 否 | 是否展示“使用原始凭证”选项 | - | - |
|
|
21
|
+
| inDataSet | `boolean | null` | `undefined` | 否 | 是否处于数据集场景 | - | - |
|
|
22
|
+
|
|
23
|
+
## 事件 (Events)
|
|
24
|
+
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| update:ak | `@update:ak` | AccessKey 变更时触发,便于和父级表单状态保持同步。 | `value?: string | null` | - |
|
|
27
|
+
| update:sk | `@update:sk` | SecretKey 变更时触发,通常用于同步加密存储前的表单值。 | `value?: string | null` | - |
|
|
28
|
+
| update:isUseOriginal | `@update:isUseOriginal` | “使用原始凭证”开关变化时触发,可据此切换输入项显隐。 | `value?: boolean | null` | - |
|
|
29
|
+
|
|
30
|
+
### 事件参数说明
|
|
31
|
+
**update:ak**
|
|
32
|
+
|
|
33
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
34
|
+
| --- | --- | --- | --- | --- |
|
|
35
|
+
| value | `string | null` | 否 | - | 当前输入的 AccessKey 值。 |
|
|
36
|
+
|
|
37
|
+
**update:sk**
|
|
38
|
+
|
|
39
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
40
|
+
| --- | --- | --- | --- | --- |
|
|
41
|
+
| value | `string | null` | 否 | - | 当前输入的 SecretKey 值。 |
|
|
42
|
+
|
|
43
|
+
**update:isUseOriginal**
|
|
44
|
+
|
|
45
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
46
|
+
| --- | --- | --- | --- | --- |
|
|
47
|
+
| value | `boolean | null` | 否 | - | 当前是否使用原始凭证。 |
|
|
48
|
+
|
|
49
|
+
## 使用示例
|
|
50
|
+
### 任务配置中的 AK/SK 凭证录入
|
|
51
|
+
**场景**: 录入任务访问外部对象存储或服务所需的访问凭证。
|
|
52
|
+
|
|
53
|
+
通过多个 v-model 同步 AccessKey、SecretKey 和原始凭证开关。
|
|
54
|
+
|
|
55
|
+
**使用的 API**: 属性: ak, sk, isUseOriginal, isShowUseOriginal | 事件: update:ak, update:sk, update:isUseOriginal
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<script setup lang="ts">
|
|
59
|
+
import { ref } from 'vue';
|
|
60
|
+
import { AKSK } from '@ksyun-internal/versatile';
|
|
61
|
+
|
|
62
|
+
const ak = ref('AKLTxxxxxxxx');
|
|
63
|
+
const sk = ref('********');
|
|
64
|
+
const isUseOriginal = ref(false);
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<AKSK
|
|
69
|
+
v-model:ak="ak"
|
|
70
|
+
v-model:sk="sk"
|
|
71
|
+
v-model:isUseOriginal="isUseOriginal"
|
|
72
|
+
:is-show-use-original="true"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 切换是否沿用原始凭证
|
|
78
|
+
**场景**: 在数据同步任务中切换使用系统默认凭证或自定义凭证。
|
|
79
|
+
|
|
80
|
+
结合 update:isUseOriginal 在不同凭证来源之间切换。
|
|
81
|
+
|
|
82
|
+
**使用的 API**: 属性: ak, sk, isUseOriginal, isShowUseOriginal, inDataSet | 事件: update:isUseOriginal
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
import { ref } from 'vue';
|
|
87
|
+
import { AKSK } from '@ksyun-internal/versatile';
|
|
88
|
+
|
|
89
|
+
const ak = ref('AKLTxxxx');
|
|
90
|
+
const sk = ref('******');
|
|
91
|
+
const isUseOriginal = ref(true);
|
|
92
|
+
const handleToggle = (value: boolean) => {
|
|
93
|
+
console.log('use original credentials:', value);
|
|
94
|
+
};
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<template>
|
|
98
|
+
<AKSK
|
|
99
|
+
v-model:ak="ak"
|
|
100
|
+
v-model:sk="sk"
|
|
101
|
+
v-model:isUseOriginal="isUseOriginal"
|
|
102
|
+
:is-show-use-original="true"
|
|
103
|
+
:in-data-set="true"
|
|
104
|
+
@update:isUseOriginal="handleToggle"
|
|
105
|
+
/>
|
|
106
|
+
</template>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## 相关组件
|
|
110
|
+
FormItemInput
|
|
111
|
+
|
package/docs_for_llm/az.doc.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
可用区(Availability Zone)选择组件。
|
|
4
4
|
|
|
5
|
-
**关键词**: az, zone, 可用区,
|
|
5
|
+
**关键词**: az, zone, 可用区, 机房, availability zone, az select, 可用区选择
|
|
6
6
|
|
|
7
|
-
**使用场景**:
|
|
7
|
+
**使用场景**: 购买页选择可用区、与地域联动切换机房、资源部署位置选择、高可用架构中选择目标可用区
|
|
8
8
|
|
|
9
9
|
## 导入语句
|
|
10
10
|
```typescript
|
|
@@ -12,21 +12,27 @@ import { AZ } from '@ksyun-internal/versatile';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| modelValue | `string` | `undefined` | 否 | 选中的可用区编码 | `<AZ v-model="azCode" />` |
|
|
18
|
-
| regionCode | `string` | `undefined` | 否 | 所属地域编码 | `<AZ regionCode="cn-beijing-6" />` |
|
|
19
|
-
| packages | `AZ[]` | `undefined` | 否 | 可用区配置列表(通常从Region组件联动获取,或通过API获取) | `<AZ :packages="packages" />` |
|
|
20
|
-
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多 | - |
|
|
21
|
-
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接ID | - |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `string` | `undefined` | 否 | 选中的可用区编码 | - | `<AZ v-model="azCode" />` |
|
|
18
|
+
| regionCode | `string` | `undefined` | 否 | 所属地域编码 | - | `<AZ regionCode="cn-beijing-6" />` |
|
|
19
|
+
| packages | `AZ[]` | `undefined` | 否 | 可用区配置列表(通常从Region组件联动获取,或通过API获取) | - | `<AZ :packages="packages" />` |
|
|
20
|
+
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多 | - | - |
|
|
21
|
+
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接ID | - | - |
|
|
22
22
|
|
|
23
23
|
## 事件 (Events)
|
|
24
24
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
25
|
| --- | --- | --- | --- | --- |
|
|
26
26
|
| change | `update:modelValue` | 可用区改变时触发 | `value: string` | `<AZ @update:modelValue="v => console.log(v)" /></AZ>` |
|
|
27
27
|
|
|
28
|
-
###
|
|
29
|
-
**change
|
|
28
|
+
### 事件参数说明
|
|
29
|
+
**change**
|
|
30
|
+
|
|
31
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| value | `string` | 是 | - | 新的AZCode |
|
|
34
|
+
|
|
35
|
+
事件处理示例:
|
|
30
36
|
```typescript
|
|
31
37
|
(val) => { console.log(val); }
|
|
32
38
|
```
|
|
@@ -12,11 +12,11 @@ import { Badge } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| text | `string | number` | `undefined` | 否 | 显示的文本内容或数字。如果不传,则显示为一个小红点。 | `<Badge :text="10"></Badge>` |
|
|
18
|
-
| max | `number` | `undefined` | 否 | 显示的最大数值,超过最大值会显示为 max+。仅在 text 为 numeric 时生效。 | `<Badge :text="100" :max="99"></Badge>` |
|
|
19
|
-
| disabled | `boolean` | `false` | 否 | 是否隐藏徽标 | `<Badge disabled></Badge>` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| text | `string | number` | `undefined` | 否 | 显示的文本内容或数字。如果不传,则显示为一个小红点。 | - | `<Badge :text="10"></Badge>` |
|
|
18
|
+
| max | `number` | `undefined` | 否 | 显示的最大数值,超过最大值会显示为 max+。仅在 text 为 numeric 时生效。 | - | `<Badge :text="100" :max="99"></Badge>` |
|
|
19
|
+
| disabled | `boolean` | `false` | 否 | 是否隐藏徽标 | - | `<Badge disabled></Badge>` |
|
|
20
20
|
|
|
21
21
|
## 插槽 (Slots)
|
|
22
22
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
@@ -24,6 +24,7 @@ import { Badge } from '@king-design/vue';
|
|
|
24
24
|
| default | 徽标包裹的元素 | `#default` | `<Badge><Button>Button</Button></Badge>` |
|
|
25
25
|
|
|
26
26
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
27
|
+
### 数字作为字符串传入
|
|
27
28
|
> **错误用法**: `<Badge text="10" :max="9">`
|
|
28
29
|
> **正确写法**: `<Badge :text="10" :max="9">`
|
|
29
30
|
> **说明**: 如果 text 传入的是字符串 "10",max 属性可能无法正确比较。建议数字类型使用 v-bind 传入。
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
计费类型选择组件,支持按量付费、包年包月等多种计费模式展示与选择。
|
|
4
4
|
|
|
5
|
-
**关键词**: bill, price, charge, 计费,
|
|
5
|
+
**关键词**: bill, price, charge, 计费, 价格, 计费模式, 按量付费, 包年包月
|
|
6
6
|
|
|
7
|
-
**使用场景**:
|
|
7
|
+
**使用场景**: 购买页选择计费模式、切换按量和包年包月、试用与正式计费方式选择
|
|
8
8
|
|
|
9
9
|
## 导入语句
|
|
10
10
|
```typescript
|
|
@@ -12,21 +12,27 @@ import { BillTypes } from '@ksyun-internal/versatile';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| modelValue | `number` | `undefined` | 否 | 选中的计费类型ID | `<BillTypes v-model="billType" />` |
|
|
18
|
-
| packages | `BillType[]` | `undefined` | 否 | 计费类型配置列表 | `<BillTypes :packages="packages" />` |
|
|
19
|
-
| showTrial | `boolean` | `false` | 否 | 是否显示试用选项 | `<BillTypes showTrial />` |
|
|
20
|
-
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多链接 | `<BillTypes showLearnMore />` |
|
|
21
|
-
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接的帮助文档ID | `<BillTypes :learnMoreUrl="123" />` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| modelValue | `number` | `undefined` | 否 | 选中的计费类型ID | - | `<BillTypes v-model="billType" />` |
|
|
18
|
+
| packages | `BillType[]` | `undefined` | 否 | 计费类型配置列表 | - | `<BillTypes :packages="packages" />` |
|
|
19
|
+
| showTrial | `boolean` | `false` | 否 | 是否显示试用选项 | - | `<BillTypes showTrial />` |
|
|
20
|
+
| showLearnMore | `boolean` | `true` | 否 | 是否显示了解更多链接 | - | `<BillTypes showLearnMore />` |
|
|
21
|
+
| learnMoreUrl | `number` | `undefined` | 否 | 了解更多链接的帮助文档ID | - | `<BillTypes :learnMoreUrl="123" />` |
|
|
22
22
|
|
|
23
23
|
## 事件 (Events)
|
|
24
24
|
| 事件名 | Vue事件名 | 说明 | 回调参数 | 示例 |
|
|
25
25
|
| --- | --- | --- | --- | --- |
|
|
26
26
|
| change | `update:modelValue` | 选中值改变时触发 | `value: number` | `<BillTypes @update:modelValue="v => console.log(v)" /></BillTypes>` |
|
|
27
27
|
|
|
28
|
-
###
|
|
29
|
-
**change
|
|
28
|
+
### 事件参数说明
|
|
29
|
+
**change**
|
|
30
|
+
|
|
31
|
+
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|
|
32
|
+
| --- | --- | --- | --- | --- |
|
|
33
|
+
| value | `number` | 是 | - | 新的计费类型ID |
|
|
34
|
+
|
|
35
|
+
事件处理示例:
|
|
30
36
|
```typescript
|
|
31
37
|
(val) => { console.log(val); }
|
|
32
38
|
```
|
|
@@ -12,9 +12,9 @@ import { Breadcrumb, BreadcrumbItem } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| separator | `string` | `undefined` | 否 | 指定分隔符 | `<Breadcrumb separator=">"></Breadcrumb>` |
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| separator | `string` | `undefined` | 否 | 指定分隔符 | - | `<Breadcrumb separator=">"></Breadcrumb>` |
|
|
18
18
|
|
|
19
19
|
## 插槽 (Slots)
|
|
20
20
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
@@ -30,6 +30,7 @@ import { Breadcrumb, BreadcrumbItem } from '@king-design/vue';
|
|
|
30
30
|
| to | `string | object` | 指定超链接地址,支持字符串路径或 Vue Router 路由对象 | `<BreadcrumbItem to="/products">产品中心</BreadcrumbItem>` |
|
|
31
31
|
|
|
32
32
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
33
|
+
### 最后一项不应该有链接
|
|
33
34
|
> **错误用法**: `<Breadcrumb>
|
|
34
35
|
<BreadcrumbItem to="/">首页</BreadcrumbItem>
|
|
35
36
|
<BreadcrumbItem to="/current">当前页面</BreadcrumbItem>
|
|
@@ -40,6 +41,7 @@ import { Breadcrumb, BreadcrumbItem } from '@king-design/vue';
|
|
|
40
41
|
</Breadcrumb>`
|
|
41
42
|
> **说明**: 面包屑最后一项表示当前页面,不应该设置链接
|
|
42
43
|
|
|
44
|
+
### 直接使用 Breadcrumb 未包含 BreadcrumbItem
|
|
43
45
|
> **错误用法**: `<Breadcrumb>
|
|
44
46
|
<span>首页</span>
|
|
45
47
|
<span>产品</span>
|
|
@@ -50,6 +52,7 @@ import { Breadcrumb, BreadcrumbItem } from '@king-design/vue';
|
|
|
50
52
|
</Breadcrumb>`
|
|
51
53
|
> **说明**: Breadcrumb 组件必须配合 BreadcrumbItem 子组件使用
|
|
52
54
|
|
|
55
|
+
### 路由对象未使用绑定语法
|
|
53
56
|
> **错误用法**: `<BreadcrumbItem to="{path: '/home'}">首页</BreadcrumbItem>`
|
|
54
57
|
> **正确写法**: `<BreadcrumbItem :to="{path: '/home'}">首页</BreadcrumbItem>`
|
|
55
58
|
> **说明**: 传入对象类型时需要使用 v-bind (:to) 语法
|
|
@@ -12,22 +12,35 @@ import { Button, ButtonGroup } from '@king-design/vue';
|
|
|
12
12
|
```
|
|
13
13
|
|
|
14
14
|
## 属性 (Props)
|
|
15
|
-
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 示例 |
|
|
16
|
-
| --- | --- | --- | --- | --- | --- |
|
|
17
|
-
| type | `"default" | "primary" | "warning" | "danger" | "success" | "secondary" | "link" | "flat" | "none"` | `"default"` | 否 | 按钮类型,决定按钮的视觉样式 | `<Button type="primary">主要按钮</Button>` |
|
|
18
|
-
| size | `"default" | "small" | "mini" | "large"` | `"default"` | 否 | 按钮尺寸 | `<Button size="small">小按钮</Button>` |
|
|
19
|
-
| icon | `boolean` | `false` | 否 | 是否为图标按钮(宽高相等) | `<Button icon><Icon class="k-icon-search" /></Button>` |
|
|
20
|
-
| circle | `boolean` | `false` | 否 | 是否为圆角按钮 | `<Button icon circle><Icon class="k-icon-plus" /></Button>` |
|
|
21
|
-
| loading | `boolean` | `false` | 否 | 是否为正在加载中的按钮,加载时按钮会禁用点击 | `<Button type="primary" :loading="isLoading">提交中...</Button>` |
|
|
22
|
-
| disabled | `boolean` | `false` | 否 | 是否禁用状态 | `<Button disabled>禁用按钮</Button>` |
|
|
23
|
-
| fluid | `boolean` | `false` | 否 | 是否宽度100% | `<Button fluid>块级按钮</Button>` |
|
|
24
|
-
| htmlType | `string` | `"button"` | 否 | 按钮<button>元素的type属性 | `<Button htmlType="submit">提交表单</Button>` |
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 | 标签 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
17
|
+
| type | `"default" | "primary" | "warning" | "danger" | "success" | "secondary" | "link" | "flat" | "none"` | `"default"` | 否 | 按钮类型,决定按钮的视觉样式 | - | `<Button type="primary">主要按钮</Button>` |
|
|
18
|
+
| size | `"default" | "small" | "mini" | "large"` | `"default"` | 否 | 按钮尺寸 | - | `<Button size="small">小按钮</Button>` |
|
|
19
|
+
| icon | `boolean` | `false` | 否 | 是否为图标按钮(宽高相等) | - | `<Button icon><Icon class="k-icon-search" /></Button>` |
|
|
20
|
+
| circle | `boolean` | `false` | 否 | 是否为圆角按钮 | - | `<Button icon circle><Icon class="k-icon-plus" /></Button>` |
|
|
21
|
+
| loading | `boolean` | `false` | 否 | 是否为正在加载中的按钮,加载时按钮会禁用点击 | - | `<Button type="primary" :loading="isLoading">提交中...</Button>` |
|
|
22
|
+
| disabled | `boolean` | `false` | 否 | 是否禁用状态 | - | `<Button disabled>禁用按钮</Button>` |
|
|
23
|
+
| fluid | `boolean` | `false` | 否 | 是否宽度100% | - | `<Button fluid>块级按钮</Button>` |
|
|
24
|
+
| htmlType | `string` | `"button"` | 否 | 按钮<button>元素的type属性 | - | `<Button htmlType="submit">提交表单</Button>` |
|
|
25
|
+
| color | `string` | `undefined` | 否 | 自定义按钮颜色,通常用于细粒度的主题色控制 | - | `<Button color="#1677ff">自定义颜色按钮</Button>` |
|
|
26
|
+
| tagName | `string` | `"button"` | 否 | 按钮渲染后的实际HTML元素,例如可以传入"a"来渲染成超链接 | - | `<Button tagName="a" href="https://example.com" target="_blank">链接按钮</Button>` |
|
|
27
|
+
| autofocus | `boolean` | `undefined` | 否 | 原生 autofocus 属性,页面加载后自动聚焦按钮 | `native` | `<Button autofocus>自动聚焦</Button>` |
|
|
28
|
+
| form | `string` | `undefined` | 否 | 原生 form 属性,指定按钮关联的表单 id | `native` | `<Button form="loginForm" htmlType="submit">提交</Button>` |
|
|
29
|
+
| formaction | `string` | `undefined` | 否 | 原生 formaction 属性,覆盖表单提交地址 | `native` | `<Button formaction="/api/submit" htmlType="submit">提交</Button>` |
|
|
30
|
+
| formenctype | `string` | `undefined` | 否 | 原生 formenctype 属性,指定表单提交编码类型 | `native` | `<Button formenctype="multipart/form-data" htmlType="submit">上传</Button>` |
|
|
31
|
+
| formmethod | `"post" | "get" | "dialog" | string` | `undefined` | 否 | 原生 formmethod 属性,指定表单提交方法 | `native` | `<Button formmethod="post" htmlType="submit">提交</Button>` |
|
|
32
|
+
| formnovalidate | `boolean` | `undefined` | 否 | 原生 formnovalidate 属性,提交时跳过原生表单校验 | `native` | `<Button formnovalidate htmlType="submit">跳过校验</Button>` |
|
|
33
|
+
| formtarget | `string` | `undefined` | 否 | 原生 formtarget 属性,指定表单响应的打开位置 | `native` | `<Button formtarget="_blank" htmlType="submit">新窗口提交</Button>` |
|
|
34
|
+
| href | `string` | `undefined` | 否 | 原生 href 属性,当 tagName="a" 时指定跳转链接 | `native` | `<Button tagName="a" href="https://example.com">外部链接</Button>` |
|
|
35
|
+
| target | `string` | `undefined` | 否 | 原生 target 属性,当 tagName="a" 时指定打开方式 | `native` | `<Button tagName="a" href="https://example.com" target="_blank">新窗口打开</Button>` |
|
|
36
|
+
| download | `string` | `undefined` | 否 | 原生 download 属性,当 tagName="a" 时提示浏览器下载资源 | `native` | `<Button tagName="a" href="/file.pdf" download="demo.pdf">下载文件</Button>` |
|
|
37
|
+
| value | `*` | `undefined` | 否 | 对于radio/checkbox类型的按钮组,给按钮指定选中时的值 | - | `<Button value="option1">选项1</Button>` |
|
|
38
|
+
| name | `string` | `undefined` | 否 | 原生 name 属性 | `native` | `<Button name="submitBtn">提交</Button>` |
|
|
39
|
+
| tabindex | `string | number` | `undefined` | 否 | 原生 tabindex 属性,控制键盘 Tab 导航顺序 | `native` | `<Button :tabindex="-1">跳过焦点</Button>` |
|
|
40
|
+
| ghost | `boolean` | `false` | 否 | 展示透明背景的按钮,适用于深色背景 | - | `<div style="background: #001529; padding: 16px;">
|
|
28
41
|
<Button ghost>幽灵按钮</Button>
|
|
29
42
|
</div>` |
|
|
30
|
-
| class | `string | Record<string, boolean>` | `undefined` | 否 | 给按钮添加自定义类名,通常用于通过 CSS 类名来定义按钮的具体视觉样式 | `<Button class="my-custom-btn">自定义类名按钮</Button>` |
|
|
43
|
+
| class | `string | Record<string, boolean>` | `undefined` | 否 | 给按钮添加自定义类名,通常用于通过 CSS 类名来定义按钮的具体视觉样式 | - | `<Button class="my-custom-btn">自定义类名按钮</Button>` |
|
|
31
44
|
|
|
32
45
|
## 插槽 (Slots)
|
|
33
46
|
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
@@ -37,10 +50,10 @@ import { Button, ButtonGroup } from '@king-design/vue';
|
|
|
37
50
|
## 方法 (Methods)
|
|
38
51
|
| 方法名 | 说明 | 参数 | 返回值 |
|
|
39
52
|
| --- | --- | --- | --- |
|
|
40
|
-
| showLoading | 展示 loading 状态 |
|
|
41
|
-
| hideLoading | 取消 loading 状态 |
|
|
42
|
-
| disable | 禁用按钮 |
|
|
43
|
-
| enable | 启用按钮 |
|
|
53
|
+
| showLoading | 展示 loading 状态 | `-` | `void` |
|
|
54
|
+
| hideLoading | 取消 loading 状态 | `-` | `void` |
|
|
55
|
+
| disable | 禁用按钮 | `-` | `void` |
|
|
56
|
+
| enable | 启用按钮 | `-` | `void` |
|
|
44
57
|
|
|
45
58
|
## 子组件 (Sub-Components)
|
|
46
59
|
### ButtonGroup
|
|
@@ -66,14 +79,17 @@ import { Button, ButtonGroup } from '@king-design/vue';
|
|
|
66
79
|
| btnWidth | `number | string` | 指定按钮组每个按钮的固定宽度 | `<ButtonGroup btnWidth="100px"></ButtonGroup>` |
|
|
67
80
|
|
|
68
81
|
## 常见错误与正确用法 (Anti-Hallucination)
|
|
82
|
+
### type 属性值拼写错误
|
|
69
83
|
> **错误用法**: `<Button type="primay">`
|
|
70
84
|
> **正确写法**: `<Button type="primary">`
|
|
71
85
|
> **说明**: type 必须使用预定义的值:default, primary, warning, danger, success, secondary, link, flat, none。常见错误是 primary 拼写为 primay
|
|
72
86
|
|
|
87
|
+
### 使用不存在的 size 值 (Button)
|
|
73
88
|
> **错误用法**: `<Button size="medium">`
|
|
74
89
|
> **正确写法**: `<Button size="default">`
|
|
75
90
|
> **说明**: Button 的 size 只支持 large, default, small, mini。常见错误是使用 medium 值。
|
|
76
91
|
|
|
92
|
+
### 单选/复选按钮组未给 Button 设置 value
|
|
77
93
|
> **错误用法**: `<ButtonGroup checkType="radio" v-model="selected">
|
|
78
94
|
<Button>选项A</Button>
|
|
79
95
|
<Button>选项B</Button>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# 链接按钮 (ButtonLink)
|
|
2
|
+
|
|
3
|
+
外观接近按钮但语义偏链接的操作组件,适合放在详情页头部、说明区或空状态中承载跳转型动作。
|
|
4
|
+
|
|
5
|
+
**关键词**: button link, link button, 链接按钮, 跳转按钮, 文档入口
|
|
6
|
+
|
|
7
|
+
**使用场景**: 操作区链接按钮、详情页跳转入口、空状态引导操作
|
|
8
|
+
|
|
9
|
+
## 导入语句
|
|
10
|
+
```typescript
|
|
11
|
+
import { ButtonLink } from '@ksyun-internal/versatile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 插槽 (Slots)
|
|
15
|
+
| 插槽名 | 说明 | 模板写法 | 示例 |
|
|
16
|
+
| --- | --- | --- | --- |
|
|
17
|
+
| default | 按钮内容 | `<ButtonLink>...</ButtonLink>` | - |
|
|
18
|
+
|
|
19
|
+
## 使用示例
|
|
20
|
+
### 详情页中的文档跳转入口
|
|
21
|
+
**场景**: 在操作区提供“查看文档”“前往控制台”等跳转动作。
|
|
22
|
+
|
|
23
|
+
用按钮样式突出跳转动作,同时保持链接语义。
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import { ButtonLink } from '@ksyun-internal/versatile';
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<ButtonLink>查看 API 文档</ButtonLink>
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 空状态跳转入口
|
|
36
|
+
**场景**: 在空状态或帮助提示区提供跳转型操作。
|
|
37
|
+
|
|
38
|
+
在空状态说明区域中用链接按钮承载引导操作。
|
|
39
|
+
|
|
40
|
+
```vue
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { ButtonLink } from '@ksyun-internal/versatile';
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<div>
|
|
47
|
+
<p>当前没有可用项目。</p>
|
|
48
|
+
<ButtonLink>前往创建项目</ButtonLink>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 相关组件
|
|
54
|
+
IconTooltip, Actions
|
|
55
|
+
|