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
package/components/tooltip.json
CHANGED
|
@@ -1,416 +1,505 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
2
|
+
"id": "tooltip",
|
|
3
|
+
"name": "Tooltip",
|
|
4
|
+
"displayName": "提示弹层",
|
|
5
|
+
"category": "feedback",
|
|
6
|
+
"description": "提示弹层组件,用于在鼠标悬停或点击时显示额外的提示信息。支持多种触发方式、位置、主题等配置。",
|
|
7
|
+
"importStatement": "import { Tooltip } from '@king-design/vue';",
|
|
8
|
+
"props": [
|
|
9
|
+
{
|
|
10
|
+
"name": "content",
|
|
11
|
+
"description": "提示的内容",
|
|
12
|
+
"type": {
|
|
13
|
+
"raw": "string | VNode",
|
|
14
|
+
"kind": "union"
|
|
15
|
+
},
|
|
16
|
+
"required": false,
|
|
17
|
+
"default": "undefined",
|
|
18
|
+
"usageExample": "<Tooltip content=\"提示内容\">"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "trigger",
|
|
22
|
+
"description": "触发方式",
|
|
23
|
+
"type": {
|
|
24
|
+
"raw": "\"hover\" | \"click\" | \"focus\"",
|
|
25
|
+
"kind": "union",
|
|
26
|
+
"unionTypes": [
|
|
27
|
+
"hover",
|
|
28
|
+
"click",
|
|
29
|
+
"focus"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"required": false,
|
|
33
|
+
"default": "\"hover\"",
|
|
34
|
+
"allowedValues": [
|
|
35
|
+
{
|
|
36
|
+
"value": "hover",
|
|
37
|
+
"label": "悬停触发",
|
|
38
|
+
"isDefault": true
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"value": "click",
|
|
42
|
+
"label": "点击触发"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"value": "focus",
|
|
46
|
+
"label": "聚焦触发"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"usageExample": "<Tooltip trigger=\"click\">"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "value",
|
|
53
|
+
"description": "是否展示弹层,可用 v-model 双向绑定",
|
|
54
|
+
"type": {
|
|
55
|
+
"raw": "boolean",
|
|
56
|
+
"kind": "boolean"
|
|
57
|
+
},
|
|
58
|
+
"required": false,
|
|
59
|
+
"default": "false",
|
|
60
|
+
"usageExample": "<Tooltip v-model=\"visible\">"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "disabled",
|
|
64
|
+
"description": "是否禁用提示",
|
|
65
|
+
"type": {
|
|
66
|
+
"raw": "boolean",
|
|
67
|
+
"kind": "boolean"
|
|
68
|
+
},
|
|
69
|
+
"required": false,
|
|
70
|
+
"default": "false",
|
|
71
|
+
"usageExample": "<Tooltip disabled>"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"name": "position",
|
|
75
|
+
"description": "弹层弹出的位置,默认在触发器正上方",
|
|
76
|
+
"type": {
|
|
77
|
+
"raw": "Position | \"left\" | \"bottom\" | \"right\" | \"top\"",
|
|
78
|
+
"kind": "union",
|
|
79
|
+
"unionTypes": [
|
|
80
|
+
"left",
|
|
81
|
+
"bottom",
|
|
82
|
+
"right",
|
|
83
|
+
"top"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"default": "{my: 'center bottom-10', at: 'center top', collision: 'flipfit'}",
|
|
88
|
+
"allowedValues": [
|
|
89
|
+
{
|
|
90
|
+
"value": "top",
|
|
91
|
+
"label": "上方显示",
|
|
92
|
+
"isDefault": true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"value": "bottom",
|
|
96
|
+
"label": "下方显示"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"value": "left",
|
|
100
|
+
"label": "左侧显示"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"value": "right",
|
|
104
|
+
"label": "右侧显示"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"usageExample": "<Tooltip position=\"bottom\">"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"name": "collison",
|
|
111
|
+
"description": "碰撞检测策略,控制弹层超出边界时的处理方式。注意源码字段名拼写为 collison。",
|
|
112
|
+
"type": {
|
|
113
|
+
"raw": "Collision | [Collision, Collision]",
|
|
114
|
+
"kind": "union"
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"default": "undefined",
|
|
118
|
+
"usageExample": "<Tooltip :collison=\"'flipfit'\">"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "theme",
|
|
122
|
+
"description": "主题",
|
|
123
|
+
"type": {
|
|
124
|
+
"raw": "\"dark\" | \"light\"",
|
|
125
|
+
"kind": "union",
|
|
126
|
+
"unionTypes": [
|
|
127
|
+
"dark",
|
|
128
|
+
"light"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"default": "\"dark\"",
|
|
133
|
+
"allowedValues": [
|
|
134
|
+
{
|
|
135
|
+
"value": "dark",
|
|
136
|
+
"label": "深色主题",
|
|
137
|
+
"isDefault": true
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"value": "light",
|
|
141
|
+
"label": "浅色主题"
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
"usageExample": "<Tooltip theme=\"light\">"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "showArrow",
|
|
148
|
+
"description": "弹层是否展示箭头",
|
|
149
|
+
"type": {
|
|
150
|
+
"raw": "boolean",
|
|
151
|
+
"kind": "boolean"
|
|
152
|
+
},
|
|
153
|
+
"required": false,
|
|
154
|
+
"default": "true",
|
|
155
|
+
"usageExample": "<Tooltip :showArrow=\"false\">"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"name": "hoverable",
|
|
159
|
+
"description": "对于悬浮触发方式,提示弹层是否在鼠标悬浮时仍然展示",
|
|
160
|
+
"type": {
|
|
161
|
+
"raw": "boolean",
|
|
162
|
+
"kind": "boolean"
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"default": "false",
|
|
166
|
+
"usageExample": "<Tooltip hoverable>"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"name": "always",
|
|
170
|
+
"description": "是否一直保持当前展示/隐藏状态",
|
|
171
|
+
"type": {
|
|
172
|
+
"raw": "boolean",
|
|
173
|
+
"kind": "boolean"
|
|
174
|
+
},
|
|
175
|
+
"required": false,
|
|
176
|
+
"default": "false",
|
|
177
|
+
"usageExample": "<Tooltip always>"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "size",
|
|
181
|
+
"description": "弹层尺寸",
|
|
182
|
+
"type": {
|
|
183
|
+
"raw": "\"default\" | \"small\"",
|
|
184
|
+
"kind": "union",
|
|
185
|
+
"unionTypes": [
|
|
186
|
+
"default",
|
|
187
|
+
"small"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"default": "\"default\"",
|
|
192
|
+
"allowedValues": [
|
|
193
|
+
{
|
|
194
|
+
"value": "default",
|
|
195
|
+
"label": "默认尺寸",
|
|
196
|
+
"isDefault": true
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"value": "small",
|
|
200
|
+
"label": "小尺寸"
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"usageExample": "<Tooltip size=\"small\">"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "of",
|
|
207
|
+
"description": "弹出菜单的位置是相对当前触发元素还是父元素",
|
|
208
|
+
"type": {
|
|
209
|
+
"raw": "\"self\" | \"parent\" | Event",
|
|
210
|
+
"kind": "union",
|
|
211
|
+
"unionTypes": [
|
|
212
|
+
"self",
|
|
213
|
+
"parent"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
"required": false,
|
|
217
|
+
"default": "\"self\"",
|
|
218
|
+
"usageExample": "<Tooltip of=\"parent\">"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"name": "container",
|
|
222
|
+
"description": "指定弹出菜单追加的位置",
|
|
223
|
+
"type": {
|
|
224
|
+
"raw": "string | ((parentDom: Element, anchor: Node | null) => Element)",
|
|
225
|
+
"kind": "union"
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"default": "undefined",
|
|
229
|
+
"usageExample": "<Tooltip :container=\"() => document.body\">"
|
|
39
230
|
},
|
|
40
231
|
{
|
|
41
|
-
|
|
42
|
-
|
|
232
|
+
"name": "alwaysShowOnClick",
|
|
233
|
+
"description": "不管什么触发方式,重复点击触发器都不隐藏弹层",
|
|
234
|
+
"type": {
|
|
235
|
+
"raw": "boolean",
|
|
236
|
+
"kind": "boolean"
|
|
237
|
+
},
|
|
238
|
+
"required": false,
|
|
239
|
+
"default": "false",
|
|
240
|
+
"usageExample": "<Tooltip alwaysShowOnClick>"
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"events": [
|
|
244
|
+
{
|
|
245
|
+
"name": "show",
|
|
246
|
+
"vueEventName": "@show",
|
|
247
|
+
"description": "弹层展示时触发",
|
|
248
|
+
"payload": [],
|
|
249
|
+
"usageExample": "<Tooltip @show=\"handleShow\">",
|
|
250
|
+
"handlerExample": "const handleShow = () => {\n console.log('Tooltip 已展示');\n};"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"name": "hide",
|
|
254
|
+
"vueEventName": "@hide",
|
|
255
|
+
"description": "弹层隐藏时触发",
|
|
256
|
+
"payload": [],
|
|
257
|
+
"usageExample": "<Tooltip @hide=\"handleHide\">",
|
|
258
|
+
"handlerExample": "const handleHide = () => {\n console.log('Tooltip 已隐藏');\n};"
|
|
43
259
|
},
|
|
44
260
|
{
|
|
45
|
-
|
|
46
|
-
|
|
261
|
+
"name": "positioned",
|
|
262
|
+
"vueEventName": "@positioned",
|
|
263
|
+
"description": "提示弹层完成定位计算后触发,可用于读取最终落位结果。",
|
|
264
|
+
"payload": [
|
|
265
|
+
{
|
|
266
|
+
"name": "feedback",
|
|
267
|
+
"type": "Feedback",
|
|
268
|
+
"description": "定位反馈对象,描述当前 Tooltip 的最终 placement 和坐标信息。"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"usageExample": "<Tooltip @positioned=\"handlePositioned\">",
|
|
272
|
+
"handlerExample": "const handlePositioned = (feedback: Feedback) => {\n console.log('Tooltip 最终位置', feedback.placement);\n};"
|
|
47
273
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"name": "disabled",
|
|
64
|
-
"description": "是否禁用提示",
|
|
65
|
-
"type": {
|
|
66
|
-
"raw": "boolean",
|
|
67
|
-
"kind": "boolean"
|
|
68
|
-
},
|
|
69
|
-
"required": false,
|
|
70
|
-
"default": "false",
|
|
71
|
-
"usageExample": "<Tooltip disabled></Tooltip>"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"name": "position",
|
|
75
|
-
"description": "弹层弹出的位置,默认在触发器正上方",
|
|
76
|
-
"type": {
|
|
77
|
-
"raw": "Position | \"left\" | \"bottom\" | \"right\" | \"top\"",
|
|
78
|
-
"kind": "union",
|
|
79
|
-
"unionTypes": [
|
|
80
|
-
"left",
|
|
81
|
-
"bottom",
|
|
82
|
-
"right",
|
|
83
|
-
"top"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
"required": false,
|
|
87
|
-
"default": "{my: 'center bottom-10', at: 'center top', collision: 'flipfit'}",
|
|
88
|
-
"allowedValues": [
|
|
89
|
-
{
|
|
90
|
-
"value": "top",
|
|
91
|
-
"label": "上方显示",
|
|
92
|
-
"isDefault": true
|
|
274
|
+
],
|
|
275
|
+
"methods": [
|
|
276
|
+
{
|
|
277
|
+
"name": "show",
|
|
278
|
+
"description": "主动显示提示弹层。",
|
|
279
|
+
"params": [
|
|
280
|
+
{
|
|
281
|
+
"name": "shouldFocus",
|
|
282
|
+
"type": "boolean",
|
|
283
|
+
"description": "显示后是否尝试把焦点移动到弹层内容。",
|
|
284
|
+
"optional": true
|
|
285
|
+
}
|
|
286
|
+
],
|
|
287
|
+
"returnType": "void",
|
|
288
|
+
"usageExample": "tooltipRef.value?.show(true);"
|
|
93
289
|
},
|
|
94
290
|
{
|
|
95
|
-
|
|
96
|
-
|
|
291
|
+
"name": "hide",
|
|
292
|
+
"description": "主动隐藏提示弹层。",
|
|
293
|
+
"params": [
|
|
294
|
+
{
|
|
295
|
+
"name": "immediately",
|
|
296
|
+
"type": "boolean",
|
|
297
|
+
"description": "是否立即隐藏,用于手动控制点击确认型 Tooltip 的关闭时机。"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"returnType": "void",
|
|
301
|
+
"usageExample": "tooltipRef.value?.hide(true);"
|
|
97
302
|
},
|
|
98
303
|
{
|
|
99
|
-
|
|
100
|
-
|
|
304
|
+
"name": "position",
|
|
305
|
+
"description": "重新计算提示弹层的位置。",
|
|
306
|
+
"params": [
|
|
307
|
+
{
|
|
308
|
+
"name": "callback",
|
|
309
|
+
"type": "(feedback: Feedback) => void",
|
|
310
|
+
"description": "定位完成后的回调,可读取最终 placement 和坐标。",
|
|
311
|
+
"optional": true
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
"returnType": "void",
|
|
315
|
+
"usageExample": "tooltipRef.value?.position((feedback) => console.log(feedback.placement));"
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
"typeDefinitions": [
|
|
319
|
+
{
|
|
320
|
+
"name": "Position",
|
|
321
|
+
"definition": "type Position = {\n my?: string | [string, string]\n at?: string | [string, string]\n collision?: Collision | [Collision, Collision]\n collisionDirection?: ['left'] | ['top'] | ['left', 'top']\n}",
|
|
322
|
+
"description": "弹层位置配置"
|
|
101
323
|
},
|
|
102
324
|
{
|
|
103
|
-
|
|
104
|
-
|
|
325
|
+
"name": "Collision",
|
|
326
|
+
"definition": "type Collision = 'fit' | 'flip' | 'flipfit' | 'none'",
|
|
327
|
+
"description": "碰撞检测行为"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "Feedback",
|
|
331
|
+
"definition": "type Feedback = {\n placement?: string\n left?: number\n top?: number\n}",
|
|
332
|
+
"description": "定位反馈结果,描述 Tooltip 最终落位方向和坐标信息。"
|
|
105
333
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
"value": "dark",
|
|
125
|
-
"label": "深色主题",
|
|
126
|
-
"isDefault": true
|
|
334
|
+
],
|
|
335
|
+
"examples": [
|
|
336
|
+
{
|
|
337
|
+
"id": "tooltip_basic",
|
|
338
|
+
"title": "基础用法",
|
|
339
|
+
"description": "基本的悬浮提示",
|
|
340
|
+
"difficulty": "easy",
|
|
341
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"这是一个提示\">\n <Button>悬浮查看</Button>\n </Tooltip>\n</template>",
|
|
342
|
+
"tags": [
|
|
343
|
+
"basic",
|
|
344
|
+
"hover"
|
|
345
|
+
],
|
|
346
|
+
"usedProps": [
|
|
347
|
+
"content"
|
|
348
|
+
],
|
|
349
|
+
"usedEvents": [],
|
|
350
|
+
"usedMethods": [],
|
|
351
|
+
"scenario": "创建一个基本的悬浮提示"
|
|
127
352
|
},
|
|
128
353
|
{
|
|
129
|
-
|
|
130
|
-
|
|
354
|
+
"id": "tooltip_position",
|
|
355
|
+
"title": "不同位置",
|
|
356
|
+
"description": "在不同方向显示提示",
|
|
357
|
+
"difficulty": "easy",
|
|
358
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"上方提示\" position=\"top\">\n <Button>上</Button>\n </Tooltip>\n <Tooltip content=\"下方提示\" position=\"bottom\">\n <Button>下</Button>\n </Tooltip>\n <Tooltip content=\"左侧提示\" position=\"left\">\n <Button>左</Button>\n </Tooltip>\n <Tooltip content=\"右侧提示\" position=\"right\">\n <Button>右</Button>\n </Tooltip>\n</template>",
|
|
359
|
+
"tags": [
|
|
360
|
+
"position",
|
|
361
|
+
"direction"
|
|
362
|
+
],
|
|
363
|
+
"usedProps": [
|
|
364
|
+
"content",
|
|
365
|
+
"position"
|
|
366
|
+
],
|
|
367
|
+
"usedEvents": [],
|
|
368
|
+
"usedMethods": [],
|
|
369
|
+
"scenario": "设置提示显示的位置"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "tooltip_theme",
|
|
373
|
+
"title": "主题切换",
|
|
374
|
+
"description": "深色和浅色主题",
|
|
375
|
+
"difficulty": "easy",
|
|
376
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"深色主题\" theme=\"dark\">\n <Button>深色</Button>\n </Tooltip>\n <Tooltip content=\"浅色主题\" theme=\"light\">\n <Button>浅色</Button>\n </Tooltip>\n</template>",
|
|
377
|
+
"tags": [
|
|
378
|
+
"theme",
|
|
379
|
+
"dark",
|
|
380
|
+
"light"
|
|
381
|
+
],
|
|
382
|
+
"usedProps": [
|
|
383
|
+
"content",
|
|
384
|
+
"theme"
|
|
385
|
+
],
|
|
386
|
+
"usedEvents": [],
|
|
387
|
+
"usedMethods": [],
|
|
388
|
+
"scenario": "使用不同主题的提示"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"id": "tooltip_trigger",
|
|
392
|
+
"title": "触发方式",
|
|
393
|
+
"description": "不同的触发方式",
|
|
394
|
+
"difficulty": "easy",
|
|
395
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button, Input } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"悬浮触发\" trigger=\"hover\">\n <Button>悬浮</Button>\n </Tooltip>\n <Tooltip content=\"点击触发\" trigger=\"click\">\n <Button>点击</Button>\n </Tooltip>\n <Tooltip content=\"聚焦触发\" trigger=\"focus\">\n <Input placeholder=\"聚焦查看\" />\n </Tooltip>\n</template>",
|
|
396
|
+
"tags": [
|
|
397
|
+
"trigger",
|
|
398
|
+
"click",
|
|
399
|
+
"focus"
|
|
400
|
+
],
|
|
401
|
+
"usedProps": [
|
|
402
|
+
"content",
|
|
403
|
+
"trigger"
|
|
404
|
+
],
|
|
405
|
+
"usedEvents": [],
|
|
406
|
+
"usedMethods": [],
|
|
407
|
+
"scenario": "使用不同的触发方式"
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"id": "tooltip_hoverable",
|
|
411
|
+
"title": "可交互内容",
|
|
412
|
+
"description": "提示内容可悬浮交互",
|
|
413
|
+
"difficulty": "medium",
|
|
414
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip hoverable>\n <Button>悬浮查看</Button>\n <template #content>\n <a href=\"#\">可点击的链接</a>\n </template>\n </Tooltip>\n</template>",
|
|
415
|
+
"tags": [
|
|
416
|
+
"hoverable",
|
|
417
|
+
"interactive"
|
|
418
|
+
],
|
|
419
|
+
"usedProps": [
|
|
420
|
+
"hoverable"
|
|
421
|
+
],
|
|
422
|
+
"usedEvents": [],
|
|
423
|
+
"usedMethods": [],
|
|
424
|
+
"scenario": "提示内容中包含可交互元素"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
"id": "tooltip_icon",
|
|
428
|
+
"title": "图标提示",
|
|
429
|
+
"description": "图标配合提示",
|
|
430
|
+
"difficulty": "easy",
|
|
431
|
+
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Icon } from '@king-design/vue';\n</script>\n<template>\n <span>价格 <Tooltip content=\"含税价格\"><Icon class=\"k-icon-question\" /></Tooltip></span>\n</template>",
|
|
432
|
+
"tags": [
|
|
433
|
+
"icon",
|
|
434
|
+
"help"
|
|
435
|
+
],
|
|
436
|
+
"usedProps": [
|
|
437
|
+
"content"
|
|
438
|
+
],
|
|
439
|
+
"usedEvents": [],
|
|
440
|
+
"usedMethods": [],
|
|
441
|
+
"scenario": "图标配合提示说明"
|
|
131
442
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
},
|
|
142
|
-
"required": false,
|
|
143
|
-
"default": "true",
|
|
144
|
-
"usageExample": "<Tooltip :showArrow=\"false\"></Tooltip>"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "hoverable",
|
|
148
|
-
"description": "对于悬浮触发方式,提示弹层是否在鼠标悬浮时仍然展示",
|
|
149
|
-
"type": {
|
|
150
|
-
"raw": "boolean",
|
|
151
|
-
"kind": "boolean"
|
|
152
|
-
},
|
|
153
|
-
"required": false,
|
|
154
|
-
"default": "false",
|
|
155
|
-
"usageExample": "<Tooltip hoverable></Tooltip>"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"name": "always",
|
|
159
|
-
"description": "是否一直保持当前展示/隐藏状态",
|
|
160
|
-
"type": {
|
|
161
|
-
"raw": "boolean",
|
|
162
|
-
"kind": "boolean"
|
|
163
|
-
},
|
|
164
|
-
"required": false,
|
|
165
|
-
"default": "false",
|
|
166
|
-
"usageExample": "<Tooltip always></Tooltip>"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"name": "size",
|
|
170
|
-
"description": "弹层尺寸",
|
|
171
|
-
"type": {
|
|
172
|
-
"raw": "\"default\" | \"small\"",
|
|
173
|
-
"kind": "union",
|
|
174
|
-
"unionTypes": [
|
|
175
|
-
"default",
|
|
176
|
-
"small"
|
|
177
|
-
]
|
|
178
|
-
},
|
|
179
|
-
"required": false,
|
|
180
|
-
"default": "\"default\"",
|
|
181
|
-
"allowedValues": [
|
|
182
|
-
{
|
|
183
|
-
"value": "default",
|
|
184
|
-
"label": "默认尺寸",
|
|
185
|
-
"isDefault": true
|
|
443
|
+
],
|
|
444
|
+
"commonMistakes": [
|
|
445
|
+
{
|
|
446
|
+
"id": "tooltip_missing_trigger",
|
|
447
|
+
"description": "未提供触发元素",
|
|
448
|
+
"wrongCode": "<Tooltip content=\"提示\" />",
|
|
449
|
+
"correctCode": "<Tooltip content=\"提示\">\n <Button>触发器</Button>\n</Tooltip>",
|
|
450
|
+
"explanation": "Tooltip 需要包裹一个子元素作为触发器",
|
|
451
|
+
"relatedProps": []
|
|
186
452
|
},
|
|
187
453
|
{
|
|
188
|
-
|
|
189
|
-
|
|
454
|
+
"id": "tooltip_position_typo",
|
|
455
|
+
"description": "position 值拼写错误",
|
|
456
|
+
"wrongCode": "<Tooltip position=\"buttom\">",
|
|
457
|
+
"correctCode": "<Tooltip position=\"bottom\">",
|
|
458
|
+
"explanation": "position 只支持 top, bottom, left, right,注意拼写",
|
|
459
|
+
"relatedProps": [
|
|
460
|
+
"position"
|
|
461
|
+
]
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"id": "tooltip_hoverable_content",
|
|
465
|
+
"description": "使用 hoverable 但 content 不可交互",
|
|
466
|
+
"wrongCode": "<Tooltip hoverable content=\"纯文本\" /> <!-- hoverable 无意义 -->",
|
|
467
|
+
"correctCode": "<Tooltip hoverable>\n <Button>触发</Button>\n <template #content>\n <a href=\"#\">可点击链接</a>\n </template>\n</Tooltip>",
|
|
468
|
+
"explanation": "hoverable 通常用于提示内容中有可交互元素的场景",
|
|
469
|
+
"relatedProps": [
|
|
470
|
+
"hoverable"
|
|
471
|
+
]
|
|
190
472
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"raw": "\"self\" | \"parent\" | Event",
|
|
199
|
-
"kind": "union",
|
|
200
|
-
"unionTypes": [
|
|
201
|
-
"self",
|
|
202
|
-
"parent"
|
|
203
|
-
]
|
|
204
|
-
},
|
|
205
|
-
"required": false,
|
|
206
|
-
"default": "\"self\"",
|
|
207
|
-
"usageExample": "<Tooltip of=\"parent\"></Tooltip>"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
"name": "container",
|
|
211
|
-
"description": "指定弹出菜单追加的位置",
|
|
212
|
-
"type": {
|
|
213
|
-
"raw": "string | ((parentDom: Element, anchor: Node | null) => Element)",
|
|
214
|
-
"kind": "union"
|
|
215
|
-
},
|
|
216
|
-
"required": false,
|
|
217
|
-
"default": "undefined",
|
|
218
|
-
"usageExample": "<Tooltip :container=\"() => document.body\"></Tooltip>"
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
"events": [
|
|
222
|
-
{
|
|
223
|
-
"name": "show",
|
|
224
|
-
"vueEventName": "@show",
|
|
225
|
-
"description": "弹层展示时触发",
|
|
226
|
-
"payload": [],
|
|
227
|
-
"usageExample": "<Tooltip @show=\"handleShow\"></Tooltip>",
|
|
228
|
-
"handlerExample": "const handleShow = () => {\n console.log('Tooltip 已展示');\n};"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
"name": "hide",
|
|
232
|
-
"vueEventName": "@hide",
|
|
233
|
-
"description": "弹层隐藏时触发",
|
|
234
|
-
"payload": [],
|
|
235
|
-
"usageExample": "<Tooltip @hide=\"handleHide\"></Tooltip>",
|
|
236
|
-
"handlerExample": "const handleHide = () => {\n console.log('Tooltip 已隐藏');\n};"
|
|
237
|
-
}
|
|
238
|
-
],
|
|
239
|
-
"slots": [
|
|
240
|
-
{
|
|
241
|
-
"name": "content",
|
|
242
|
-
"description": "自定义提示内容"
|
|
243
|
-
}
|
|
244
|
-
],
|
|
245
|
-
"methods": [],
|
|
246
|
-
"typeDefinitions": [
|
|
247
|
-
{
|
|
248
|
-
"name": "Position",
|
|
249
|
-
"definition": "type Position = {\n my?: string | [string, string]\n at?: string | [string, string]\n collision?: Collision | [Collision, Collision]\n collisionDirection?: ['left'] | ['top'] | ['left', 'top']\n}",
|
|
250
|
-
"description": "弹层位置配置"
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"name": "Collision",
|
|
254
|
-
"definition": "type Collision = 'fit' | 'flip' | 'flipfit' | 'none'",
|
|
255
|
-
"description": "碰撞检测行为"
|
|
256
|
-
}
|
|
257
|
-
],
|
|
258
|
-
"examples": [
|
|
259
|
-
{
|
|
260
|
-
"id": "tooltip_basic",
|
|
261
|
-
"title": "基础用法",
|
|
262
|
-
"description": "基本的悬浮提示",
|
|
263
|
-
"difficulty": "easy",
|
|
264
|
-
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"这是一个提示\">\n <Button>悬浮查看</Button>\n </Tooltip>\n</template>",
|
|
265
|
-
"tags": [
|
|
266
|
-
"basic",
|
|
473
|
+
],
|
|
474
|
+
"searchKeywords": [
|
|
475
|
+
"提示",
|
|
476
|
+
"tooltip",
|
|
477
|
+
"悬浮提示",
|
|
478
|
+
"气泡",
|
|
479
|
+
"帮助提示",
|
|
267
480
|
"hover"
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
"
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
"scenario": "设置提示显示的位置"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"id": "tooltip_theme",
|
|
296
|
-
"title": "主题切换",
|
|
297
|
-
"description": "深色和浅色主题",
|
|
298
|
-
"difficulty": "easy",
|
|
299
|
-
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"深色主题\" theme=\"dark\">\n <Button>深色</Button>\n </Tooltip>\n <Tooltip content=\"浅色主题\" theme=\"light\">\n <Button>浅色</Button>\n </Tooltip>\n</template>",
|
|
300
|
-
"tags": [
|
|
301
|
-
"theme",
|
|
302
|
-
"dark",
|
|
303
|
-
"light"
|
|
304
|
-
],
|
|
305
|
-
"usedProps": [
|
|
306
|
-
"content",
|
|
307
|
-
"theme"
|
|
308
|
-
],
|
|
309
|
-
"usedEvents": [],
|
|
310
|
-
"usedMethods": [],
|
|
311
|
-
"scenario": "使用不同主题的提示"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
"id": "tooltip_trigger",
|
|
315
|
-
"title": "触发方式",
|
|
316
|
-
"description": "不同的触发方式",
|
|
317
|
-
"difficulty": "easy",
|
|
318
|
-
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button, Input } from '@king-design/vue';\n</script>\n<template>\n <Tooltip content=\"悬浮触发\" trigger=\"hover\">\n <Button>悬浮</Button>\n </Tooltip>\n <Tooltip content=\"点击触发\" trigger=\"click\">\n <Button>点击</Button>\n </Tooltip>\n <Tooltip content=\"聚焦触发\" trigger=\"focus\">\n <Input placeholder=\"聚焦查看\" />\n </Tooltip>\n</template>",
|
|
319
|
-
"tags": [
|
|
320
|
-
"trigger",
|
|
321
|
-
"click",
|
|
322
|
-
"focus"
|
|
323
|
-
],
|
|
324
|
-
"usedProps": [
|
|
325
|
-
"content",
|
|
326
|
-
"trigger"
|
|
327
|
-
],
|
|
328
|
-
"usedEvents": [],
|
|
329
|
-
"usedMethods": [],
|
|
330
|
-
"scenario": "使用不同的触发方式"
|
|
331
|
-
},
|
|
332
|
-
{
|
|
333
|
-
"id": "tooltip_hoverable",
|
|
334
|
-
"title": "可交互内容",
|
|
335
|
-
"description": "提示内容可悬浮交互",
|
|
336
|
-
"difficulty": "medium",
|
|
337
|
-
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Button } from '@king-design/vue';\n</script>\n<template>\n <Tooltip hoverable>\n <Button>悬浮查看</Button>\n <template #content>\n <a href=\"#\">可点击的链接</a>\n </template>\n </Tooltip>\n</template>",
|
|
338
|
-
"tags": [
|
|
339
|
-
"hoverable",
|
|
340
|
-
"interactive"
|
|
341
|
-
],
|
|
342
|
-
"usedProps": [
|
|
343
|
-
"hoverable"
|
|
344
|
-
],
|
|
345
|
-
"usedEvents": [],
|
|
346
|
-
"usedMethods": [],
|
|
347
|
-
"scenario": "提示内容中包含可交互元素"
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
"id": "tooltip_icon",
|
|
351
|
-
"title": "图标提示",
|
|
352
|
-
"description": "图标配合提示",
|
|
353
|
-
"difficulty": "easy",
|
|
354
|
-
"code": "<script setup lang=\"ts\">\nimport { Tooltip, Icon } from '@king-design/vue';\n</script>\n<template>\n <span>价格 <Tooltip content=\"含税价格\"><Icon class=\"k-icon-question\" /></Tooltip></span>\n</template>",
|
|
355
|
-
"tags": [
|
|
356
|
-
"icon",
|
|
357
|
-
"help"
|
|
358
|
-
],
|
|
359
|
-
"usedProps": [
|
|
360
|
-
"content"
|
|
361
|
-
],
|
|
362
|
-
"usedEvents": [],
|
|
363
|
-
"usedMethods": [],
|
|
364
|
-
"scenario": "图标配合提示说明"
|
|
365
|
-
}
|
|
366
|
-
],
|
|
367
|
-
"commonMistakes": [
|
|
368
|
-
{
|
|
369
|
-
"id": "tooltip_missing_trigger",
|
|
370
|
-
"description": "未提供触发元素",
|
|
371
|
-
"wrongCode": "<Tooltip content=\"提示\" />",
|
|
372
|
-
"correctCode": "<Tooltip content=\"提示\">\n <Button>触发器</Button>\n</Tooltip>",
|
|
373
|
-
"explanation": "Tooltip 需要包裹一个子元素作为触发器",
|
|
374
|
-
"relatedProps": []
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
"id": "tooltip_position_typo",
|
|
378
|
-
"description": "position 值拼写错误",
|
|
379
|
-
"wrongCode": "<Tooltip position=\"buttom\">",
|
|
380
|
-
"correctCode": "<Tooltip position=\"bottom\">",
|
|
381
|
-
"explanation": "position 只支持 top, bottom, left, right,注意拼写",
|
|
382
|
-
"relatedProps": [
|
|
383
|
-
"position"
|
|
384
|
-
]
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
"id": "tooltip_hoverable_content",
|
|
388
|
-
"description": "使用 hoverable 但 content 不可交互",
|
|
389
|
-
"wrongCode": "<Tooltip hoverable content=\"纯文本\" /> <!-- hoverable 无意义 -->",
|
|
390
|
-
"correctCode": "<Tooltip hoverable>\n <Button>触发</Button>\n <template #content>\n <a href=\"#\">可点击链接</a>\n </template>\n</Tooltip>",
|
|
391
|
-
"explanation": "hoverable 通常用于提示内容中有可交互元素的场景",
|
|
392
|
-
"relatedProps": [
|
|
393
|
-
"hoverable"
|
|
394
|
-
]
|
|
395
|
-
}
|
|
396
|
-
],
|
|
397
|
-
"searchKeywords": [
|
|
398
|
-
"提示",
|
|
399
|
-
"tooltip",
|
|
400
|
-
"悬浮提示",
|
|
401
|
-
"气泡",
|
|
402
|
-
"帮助提示",
|
|
403
|
-
"hover"
|
|
404
|
-
],
|
|
405
|
-
"useCases": [
|
|
406
|
-
"按钮功能说明",
|
|
407
|
-
"图标含义解释",
|
|
408
|
-
"表单字段提示",
|
|
409
|
-
"禁用原因说明",
|
|
410
|
-
"截断文本完整展示"
|
|
411
|
-
],
|
|
412
|
-
"relatedComponents": [
|
|
413
|
-
"Popover",
|
|
414
|
-
"Ellipsis"
|
|
415
|
-
]
|
|
481
|
+
],
|
|
482
|
+
"useCases": [
|
|
483
|
+
"按钮功能说明",
|
|
484
|
+
"图标含义解释",
|
|
485
|
+
"表单字段提示",
|
|
486
|
+
"禁用原因说明",
|
|
487
|
+
"截断文本完整展示"
|
|
488
|
+
],
|
|
489
|
+
"typeDefinitions": [
|
|
490
|
+
{
|
|
491
|
+
"name": "TooltipTrigger",
|
|
492
|
+
"definition": "type TooltipTrigger = 'hover' | 'click' | 'focus'",
|
|
493
|
+
"description": "Tooltip 的触发方式枚举,控制提示出现的交互行为。"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
"name": "TooltipTheme",
|
|
497
|
+
"definition": "type TooltipTheme = 'dark' | 'light'",
|
|
498
|
+
"description": "提示层主题枚举,用于在深浅背景之间切换视觉样式。"
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
"relatedComponents": [
|
|
502
|
+
"Popover",
|
|
503
|
+
"Ellipsis"
|
|
504
|
+
]
|
|
416
505
|
}
|