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/tour.json
CHANGED
|
@@ -1,395 +1,441 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
"name": "value",
|
|
11
|
-
"description": "当前显示的步骤索引(从0开始),可用 v-model 双向绑定",
|
|
12
|
-
"type": {
|
|
13
|
-
"raw": "number",
|
|
14
|
-
"kind": "number"
|
|
15
|
-
},
|
|
16
|
-
"required": false,
|
|
17
|
-
"default": "0",
|
|
18
|
-
"usageExample": "<Tour v-model=\"currentStep\"></Tour>"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"name": "visible",
|
|
22
|
-
"description": "是否展示引导组件",
|
|
23
|
-
"type": {
|
|
24
|
-
"raw": "boolean",
|
|
25
|
-
"kind": "boolean"
|
|
26
|
-
},
|
|
27
|
-
"required": false,
|
|
28
|
-
"default": "true",
|
|
29
|
-
"usageExample": "<Tour :visible=\"showTour\"></Tour>"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "data",
|
|
33
|
-
"description": "步骤数据数组,用于数据驱动方式",
|
|
34
|
-
"type": {
|
|
35
|
-
"raw": "TourStepData[]",
|
|
36
|
-
"kind": "array"
|
|
37
|
-
},
|
|
38
|
-
"required": false,
|
|
39
|
-
"default": "undefined",
|
|
40
|
-
"usageExample": "<Tour :data=\"tourData\"></Tour>"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"name": "beforeChange",
|
|
44
|
-
"description": "步骤切换前的回调函数,返回 false 可阻止切换,支持异步",
|
|
45
|
-
"type": {
|
|
46
|
-
"raw": "(current: number) => boolean | Promise<boolean>",
|
|
47
|
-
"kind": "function",
|
|
48
|
-
"functionSignature": "(current: number) => boolean | Promise<boolean>"
|
|
49
|
-
},
|
|
50
|
-
"required": false,
|
|
51
|
-
"default": "undefined",
|
|
52
|
-
"usageExample": "<Tour :beforeChange=\"handleBeforeChange\"></Tour>"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "maskClosable",
|
|
56
|
-
"description": "点击遮罩层是否可关闭",
|
|
57
|
-
"type": {
|
|
58
|
-
"raw": "boolean",
|
|
59
|
-
"kind": "boolean"
|
|
60
|
-
},
|
|
61
|
-
"required": false,
|
|
62
|
-
"default": "false",
|
|
63
|
-
"usageExample": "<Tour maskClosable></Tour>"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"name": "closable",
|
|
67
|
-
"description": "是否展示关闭图标",
|
|
68
|
-
"type": {
|
|
69
|
-
"raw": "boolean",
|
|
70
|
-
"kind": "boolean"
|
|
71
|
-
},
|
|
72
|
-
"required": false,
|
|
73
|
-
"default": "true",
|
|
74
|
-
"usageExample": "<Tour :closable=\"false\"></Tour>"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
"name": "doneText",
|
|
78
|
-
"description": "完成按钮文本",
|
|
79
|
-
"type": {
|
|
80
|
-
"raw": "string",
|
|
81
|
-
"kind": "string"
|
|
82
|
-
},
|
|
83
|
-
"required": false,
|
|
84
|
-
"default": "\"完成\"",
|
|
85
|
-
"usageExample": "<Tour doneText=\"结束引导\"></Tour>"
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"events": [
|
|
89
|
-
{
|
|
90
|
-
"name": "prev",
|
|
91
|
-
"vueEventName": "@prev",
|
|
92
|
-
"description": "点击上一步按钮时触发",
|
|
93
|
-
"payload": [
|
|
2
|
+
"id": "tour",
|
|
3
|
+
"name": "Tour",
|
|
4
|
+
"displayName": "引导式导航",
|
|
5
|
+
"category": "feedback",
|
|
6
|
+
"description": "引导式导航组件,用于新手引导和功能介绍。支持定位到目标元素、自定义步骤内容、步骤切换控制等功能。配合 TourStep 子组件使用。",
|
|
7
|
+
"importStatement": "import { Tour, TourStep } from '@king-design/vue';",
|
|
8
|
+
"props": [
|
|
94
9
|
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"vueEventName": "@next",
|
|
106
|
-
"description": "点击下一步按钮时触发",
|
|
107
|
-
"payload": [
|
|
10
|
+
"name": "value",
|
|
11
|
+
"description": "当前显示的步骤索引(从0开始),可用 v-model 双向绑定",
|
|
12
|
+
"type": {
|
|
13
|
+
"raw": "number",
|
|
14
|
+
"kind": "number"
|
|
15
|
+
},
|
|
16
|
+
"required": false,
|
|
17
|
+
"default": "0",
|
|
18
|
+
"usageExample": "<Tour v-model=\"currentStep\">"
|
|
19
|
+
},
|
|
108
20
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
21
|
+
"name": "theme",
|
|
22
|
+
"description": "引导浮层主题",
|
|
23
|
+
"type": {
|
|
24
|
+
"raw": "\"dark\" | \"light\"",
|
|
25
|
+
"kind": "union",
|
|
26
|
+
"unionTypes": [
|
|
27
|
+
"dark",
|
|
28
|
+
"light"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"required": false,
|
|
32
|
+
"default": "\"light\"",
|
|
33
|
+
"allowedValues": [
|
|
34
|
+
{
|
|
35
|
+
"value": "light",
|
|
36
|
+
"label": "浅色主题",
|
|
37
|
+
"isDefault": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"value": "dark",
|
|
41
|
+
"label": "深色主题"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"usageExample": "<Tour theme=\"dark\" />"
|
|
45
|
+
},
|
|
132
46
|
{
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
47
|
+
"name": "visible",
|
|
48
|
+
"description": "是否展示引导组件",
|
|
49
|
+
"type": {
|
|
50
|
+
"raw": "boolean",
|
|
51
|
+
"kind": "boolean"
|
|
52
|
+
},
|
|
53
|
+
"required": false,
|
|
54
|
+
"default": "true",
|
|
55
|
+
"usageExample": "<Tour :visible=\"showTour\">"
|
|
142
56
|
},
|
|
143
57
|
{
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
58
|
+
"name": "data",
|
|
59
|
+
"description": "步骤数据数组,用于数据驱动方式",
|
|
60
|
+
"type": {
|
|
61
|
+
"raw": "TourStepData[]",
|
|
62
|
+
"kind": "array"
|
|
63
|
+
},
|
|
64
|
+
"required": false,
|
|
65
|
+
"default": "undefined",
|
|
66
|
+
"usageExample": "<Tour :data=\"tourData\">"
|
|
153
67
|
},
|
|
154
68
|
{
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
69
|
+
"name": "beforeChange",
|
|
70
|
+
"description": "步骤切换前的回调函数,返回 false 可阻止切换,支持异步",
|
|
71
|
+
"type": {
|
|
72
|
+
"raw": "(current: number) => boolean | Promise<boolean>",
|
|
73
|
+
"kind": "function",
|
|
74
|
+
"functionSignature": "(current: number) => boolean | Promise<boolean>"
|
|
75
|
+
},
|
|
76
|
+
"required": false,
|
|
77
|
+
"default": "undefined",
|
|
78
|
+
"usageExample": "<Tour :beforeChange=\"handleBeforeChange\">"
|
|
164
79
|
},
|
|
165
80
|
{
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
},
|
|
172
|
-
"required": false,
|
|
173
|
-
"default": "\"bottom\"",
|
|
174
|
-
"allowedValues": [
|
|
175
|
-
{
|
|
176
|
-
"value": "top",
|
|
177
|
-
"label": "上方"
|
|
81
|
+
"name": "maskClosable",
|
|
82
|
+
"description": "点击遮罩层是否可关闭",
|
|
83
|
+
"type": {
|
|
84
|
+
"raw": "boolean",
|
|
85
|
+
"kind": "boolean"
|
|
178
86
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
87
|
+
"required": false,
|
|
88
|
+
"default": "false",
|
|
89
|
+
"usageExample": "<Tour maskClosable>"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "closable",
|
|
93
|
+
"description": "是否展示关闭图标",
|
|
94
|
+
"type": {
|
|
95
|
+
"raw": "boolean",
|
|
96
|
+
"kind": "boolean"
|
|
182
97
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
98
|
+
"required": false,
|
|
99
|
+
"default": "true",
|
|
100
|
+
"usageExample": "<Tour :closable=\"false\">"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "doneText",
|
|
104
|
+
"description": "完成按钮文本",
|
|
105
|
+
"type": {
|
|
106
|
+
"raw": "string",
|
|
107
|
+
"kind": "string"
|
|
187
108
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
109
|
+
"required": false,
|
|
110
|
+
"default": "\"完成\"",
|
|
111
|
+
"usageExample": "<Tour doneText=\"结束引导\">"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"name": "showArrow",
|
|
115
|
+
"description": "是否展示指向目标元素的箭头",
|
|
116
|
+
"type": {
|
|
117
|
+
"raw": "boolean",
|
|
118
|
+
"kind": "boolean"
|
|
119
|
+
},
|
|
120
|
+
"required": false,
|
|
121
|
+
"default": "true",
|
|
122
|
+
"usageExample": "<Tour :showArrow=\"false\" />"
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"events": [
|
|
126
|
+
{
|
|
127
|
+
"name": "prev",
|
|
128
|
+
"vueEventName": "@prev",
|
|
129
|
+
"description": "点击上一步按钮时触发",
|
|
130
|
+
"payload": [
|
|
131
|
+
{
|
|
132
|
+
"name": "index",
|
|
133
|
+
"type": "number",
|
|
134
|
+
"description": "当前步骤索引"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"usageExample": "<Tour @prev=\"handlePrev\">",
|
|
138
|
+
"handlerExample": "const handlePrev = (index: number) => {\n console.log(`从步骤 ${index} 返回`);\n};"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "next",
|
|
142
|
+
"vueEventName": "@next",
|
|
143
|
+
"description": "点击下一步按钮时触发",
|
|
144
|
+
"payload": [
|
|
145
|
+
{
|
|
146
|
+
"name": "index",
|
|
147
|
+
"type": "number",
|
|
148
|
+
"description": "当前步骤索引"
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"usageExample": "<Tour @next=\"handleNext\">",
|
|
152
|
+
"handlerExample": "const handleNext = (index: number) => {\n console.log(`从步骤 ${index} 前进`);\n};"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "finish",
|
|
156
|
+
"vueEventName": "@finish",
|
|
157
|
+
"description": "引导完成或关闭时触发",
|
|
158
|
+
"payload": [],
|
|
159
|
+
"usageExample": "<Tour @finish=\"handleFinish\">",
|
|
160
|
+
"handlerExample": "const handleFinish = () => {\n showTour.value = false;\n console.log('引导完成');\n};"
|
|
194
161
|
},
|
|
195
162
|
{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
163
|
+
"name": "positioned",
|
|
164
|
+
"vueEventName": "@positioned",
|
|
165
|
+
"description": "当前步骤定位完成后触发,可用于读取最终计算位置或做埋点。",
|
|
166
|
+
"payload": [
|
|
167
|
+
{
|
|
168
|
+
"name": "feedback",
|
|
169
|
+
"type": "Feedback",
|
|
170
|
+
"description": "定位反馈对象,包含当前步骤最终落位信息。"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"usageExample": "<Tour @positioned=\"handlePositioned\">",
|
|
174
|
+
"handlerExample": "const handlePositioned = (feedback: Feedback) => {\n console.log('当前定位结果', feedback.placement);\n};"
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
"methods": [],
|
|
178
|
+
"subComponents": [
|
|
179
|
+
{
|
|
180
|
+
"name": "TourStep",
|
|
181
|
+
"description": "引导步骤组件,用于定义每个引导步骤的内容",
|
|
182
|
+
"props": [
|
|
183
|
+
{
|
|
184
|
+
"name": "target",
|
|
185
|
+
"description": "目标元素,可以是 CSS 选择器或 DOM 元素。不指定则居中显示",
|
|
186
|
+
"type": {
|
|
187
|
+
"raw": "string | HTMLElement",
|
|
188
|
+
"kind": "union"
|
|
189
|
+
},
|
|
190
|
+
"required": false,
|
|
191
|
+
"default": "undefined",
|
|
192
|
+
"usageExample": "<TourStep target=\"#btn1\">"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "title",
|
|
196
|
+
"description": "步骤标题",
|
|
197
|
+
"type": {
|
|
198
|
+
"raw": "string | VNode",
|
|
199
|
+
"kind": "union"
|
|
200
|
+
},
|
|
201
|
+
"required": false,
|
|
202
|
+
"default": "undefined",
|
|
203
|
+
"usageExample": "<TourStep title=\"第一步\">"
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
"name": "content",
|
|
207
|
+
"description": "步骤内容",
|
|
208
|
+
"type": {
|
|
209
|
+
"raw": "string | VNode",
|
|
210
|
+
"kind": "union"
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"default": "undefined",
|
|
214
|
+
"usageExample": "<TourStep content=\"这是引导说明\">"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "position",
|
|
218
|
+
"description": "弹出位置",
|
|
219
|
+
"type": {
|
|
220
|
+
"raw": "\"top\" | \"right\" | \"bottom\" | \"left\"",
|
|
221
|
+
"kind": "union"
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"default": "\"bottom\"",
|
|
225
|
+
"allowedValues": [
|
|
226
|
+
{
|
|
227
|
+
"value": "top",
|
|
228
|
+
"label": "上方"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"value": "right",
|
|
232
|
+
"label": "右侧"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"value": "bottom",
|
|
236
|
+
"label": "下方",
|
|
237
|
+
"isDefault": true
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"value": "left",
|
|
241
|
+
"label": "左侧"
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"usageExample": "<TourStep position=\"top\">"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "nextText",
|
|
248
|
+
"description": "下一步按钮文本",
|
|
249
|
+
"type": {
|
|
250
|
+
"raw": "string",
|
|
251
|
+
"kind": "string"
|
|
252
|
+
},
|
|
253
|
+
"required": false,
|
|
254
|
+
"default": "\"下一步\"",
|
|
255
|
+
"usageExample": "<TourStep nextText=\"继续\">"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"name": "prevText",
|
|
259
|
+
"description": "上一步按钮文本",
|
|
260
|
+
"type": {
|
|
261
|
+
"raw": "string",
|
|
262
|
+
"kind": "string"
|
|
263
|
+
},
|
|
264
|
+
"required": false,
|
|
265
|
+
"default": "\"上一步\"",
|
|
266
|
+
"usageExample": "<TourStep prevText=\"返回\">"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"typeDefinitions": [
|
|
272
|
+
{
|
|
273
|
+
"name": "TourStepData",
|
|
274
|
+
"definition": "type TourStepData = {\n target?: string | HTMLElement\n title?: string | VNode\n content?: string | VNode\n position?: 'top' | 'right' | 'bottom' | 'left'\n nextText?: string\n prevText?: string\n}",
|
|
275
|
+
"description": "步骤数据配置"
|
|
205
276
|
},
|
|
206
277
|
{
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
"raw": "string",
|
|
211
|
-
"kind": "string"
|
|
212
|
-
},
|
|
213
|
-
"required": false,
|
|
214
|
-
"default": "\"上一步\"",
|
|
215
|
-
"usageExample": "<TourStep prevText=\"返回\"></TourStep>"
|
|
278
|
+
"name": "Feedback",
|
|
279
|
+
"definition": "type Feedback = {\n placement?: string\n left?: number\n top?: number\n}",
|
|
280
|
+
"description": "Tour 定位反馈结果,表示当前步骤最终落位方向和坐标信息。"
|
|
216
281
|
}
|
|
217
|
-
|
|
218
|
-
|
|
282
|
+
],
|
|
283
|
+
"examples": [
|
|
284
|
+
{
|
|
285
|
+
"id": "tour_basic",
|
|
286
|
+
"title": "基础用法",
|
|
287
|
+
"description": "使用 data 属性定义引导步骤",
|
|
288
|
+
"difficulty": "medium",
|
|
289
|
+
"code": "<script setup lang=\"ts\">\nimport { ref, reactive } from 'vue';\nimport { Tour, Button } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\nconst tourData = reactive([\n { target: '#btn1', title: '第一步', content: '这是第一步的引导说明', position: 'bottom' },\n { target: '#btn2', title: '第二步', content: '这是第二步的引导说明', position: 'right' }\n]);\n\nconst startTour = () => {\n showTour.value = true;\n currentStep.value = 0;\n};\n\nconst closeTour = () => {\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Button id=\"btn1\">元素1</Button>\n <Button id=\"btn2\" style=\"margin-left: 20px;\">元素2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" :data=\"tourData\" @finish=\"closeTour\" />\n <Button @click=\"startTour\">启动引导</Button>\n </div>\n</template>",
|
|
290
|
+
"tags": [
|
|
291
|
+
"basic",
|
|
292
|
+
"data"
|
|
293
|
+
],
|
|
294
|
+
"usedProps": [
|
|
295
|
+
"value",
|
|
296
|
+
"visible",
|
|
297
|
+
"data"
|
|
298
|
+
],
|
|
299
|
+
"usedEvents": [
|
|
300
|
+
"finish"
|
|
301
|
+
],
|
|
302
|
+
"usedMethods": [],
|
|
303
|
+
"scenario": "创建基本的新手引导"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"id": "tour_declarative",
|
|
307
|
+
"title": "声明式步骤",
|
|
308
|
+
"description": "使用 TourStep 子组件定义步骤",
|
|
309
|
+
"difficulty": "medium",
|
|
310
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Tour, TourStep, Button } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\n\nconst startTour = () => {\n showTour.value = true;\n currentStep.value = 0;\n};\n\nconst closeTour = () => {\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Button id=\"btn1\">元素1</Button>\n <Button id=\"btn2\" style=\"margin-left: 20px;\">元素2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" @finish=\"closeTour\">\n <TourStep target=\"#btn1\" title=\"第一步\" content=\"第一步说明\" position=\"left\" />\n <TourStep target=\"#btn2\" title=\"第二步\" position=\"top\">第二步说明</TourStep>\n </Tour>\n <Button @click=\"startTour\">启动引导</Button>\n </div>\n</template>",
|
|
311
|
+
"tags": [
|
|
312
|
+
"declarative",
|
|
313
|
+
"TourStep"
|
|
314
|
+
],
|
|
315
|
+
"usedProps": [
|
|
316
|
+
"value",
|
|
317
|
+
"visible"
|
|
318
|
+
],
|
|
319
|
+
"usedEvents": [
|
|
320
|
+
"finish"
|
|
321
|
+
],
|
|
322
|
+
"usedMethods": [],
|
|
323
|
+
"scenario": "使用声明式方式定义引导步骤"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"id": "tour_events",
|
|
327
|
+
"title": "步骤事件",
|
|
328
|
+
"description": "监听步骤切换事件",
|
|
329
|
+
"difficulty": "medium",
|
|
330
|
+
"code": "<script setup lang=\"ts\">\nimport { ref, reactive } from 'vue';\nimport { Tour, Button, Message } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\nconst tourData = reactive([\n { target: '#btn1', title: '第一步', content: '点击下一步触发 next 事件' },\n { target: '#btn2', title: '第二步', content: '点击完成触发 finish 事件' }\n]);\n\nconst handleNext = (index: number) => {\n Message.info(`下一步,当前索引: ${index}`);\n};\n\nconst handleFinish = () => {\n Message.success('引导完成!');\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Button id=\"btn1\">步骤1</Button>\n <Button id=\"btn2\">步骤2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" :data=\"tourData\" \n @next=\"handleNext\" @finish=\"handleFinish\" />\n </div>\n</template>",
|
|
331
|
+
"tags": [
|
|
332
|
+
"events",
|
|
333
|
+
"next",
|
|
334
|
+
"finish"
|
|
335
|
+
],
|
|
336
|
+
"usedProps": [
|
|
337
|
+
"value",
|
|
338
|
+
"visible",
|
|
339
|
+
"data"
|
|
340
|
+
],
|
|
341
|
+
"usedEvents": [
|
|
342
|
+
"next",
|
|
343
|
+
"finish"
|
|
344
|
+
],
|
|
345
|
+
"usedMethods": [],
|
|
346
|
+
"scenario": "监听步骤切换事件"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"id": "tour_beforechange",
|
|
350
|
+
"title": "步骤验证",
|
|
351
|
+
"description": "切换前进行验证",
|
|
352
|
+
"difficulty": "hard",
|
|
353
|
+
"code": "<script setup lang=\"ts\">\nimport { ref, reactive } from 'vue';\nimport { Tour, Button, Message } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\nconst tourData = reactive([\n { target: '#step1', title: '第一步', content: '点击下一步进行验证' },\n { target: '#step2', title: '第二步', content: '验证通过后到达这里' }\n]);\n\nconst handleBeforeChange = async (current: number): Promise<boolean> => {\n if (current === 0) {\n Message.info('正在验证...');\n await new Promise(r => setTimeout(r, 1000));\n Message.success('验证通过!');\n return true;\n }\n return true;\n};\n</script>\n<template>\n <div>\n <Button id=\"step1\">步骤1</Button>\n <Button id=\"step2\">步骤2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" :data=\"tourData\" \n :beforeChange=\"handleBeforeChange\" />\n </div>\n</template>",
|
|
354
|
+
"tags": [
|
|
355
|
+
"beforeChange",
|
|
356
|
+
"validation",
|
|
357
|
+
"async"
|
|
358
|
+
],
|
|
359
|
+
"usedProps": [
|
|
360
|
+
"value",
|
|
361
|
+
"visible",
|
|
362
|
+
"data",
|
|
363
|
+
"beforeChange"
|
|
364
|
+
],
|
|
365
|
+
"usedEvents": [],
|
|
366
|
+
"usedMethods": [],
|
|
367
|
+
"scenario": "步骤切换前进行异步验证"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"id": "tour_center",
|
|
371
|
+
"title": "居中引导",
|
|
372
|
+
"description": "无目标元素的居中显示",
|
|
373
|
+
"difficulty": "easy",
|
|
374
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Tour, TourStep, Button } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\n\nconst startTour = () => {\n showTour.value = true;\n currentStep.value = 0;\n};\n\nconst closeTour = () => {\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" @finish=\"closeTour\">\n <TourStep title=\"欢迎页面\">\n <span>没有指定目标元素时,引导弹窗会居中显示。</span>\n </TourStep>\n <TourStep title=\"功能介绍\">\n <span>适合用于展示全局性的引导说明。</span>\n </TourStep>\n </Tour>\n <Button @click=\"startTour\">启动无目标引导</Button>\n </div>\n</template>",
|
|
375
|
+
"tags": [
|
|
376
|
+
"center",
|
|
377
|
+
"noTarget"
|
|
378
|
+
],
|
|
379
|
+
"usedProps": [
|
|
380
|
+
"value",
|
|
381
|
+
"visible"
|
|
382
|
+
],
|
|
383
|
+
"usedEvents": [
|
|
384
|
+
"finish"
|
|
385
|
+
],
|
|
386
|
+
"usedMethods": [],
|
|
387
|
+
"scenario": "无目标元素的居中显示引导"
|
|
388
|
+
}
|
|
389
|
+
],
|
|
390
|
+
"commonMistakes": [
|
|
391
|
+
{
|
|
392
|
+
"id": "tour_target_selector",
|
|
393
|
+
"description": "target 选择器未匹配到元素",
|
|
394
|
+
"wrongCode": "<TourStep target=\"btn1\" /> <!-- 缺少 # -->",
|
|
395
|
+
"correctCode": "<TourStep target=\"#btn1\" />",
|
|
396
|
+
"explanation": "target 使用 CSS 选择器,ID 选择器需要加 # 前缀",
|
|
397
|
+
"relatedProps": [
|
|
398
|
+
"target"
|
|
399
|
+
]
|
|
400
|
+
},
|
|
219
401
|
{
|
|
220
|
-
|
|
221
|
-
|
|
402
|
+
"id": "tour_visible_control",
|
|
403
|
+
"description": "未正确控制 visible 状态",
|
|
404
|
+
"wrongCode": "<Tour :visible=\"true\" /> <!-- 无法关闭 -->",
|
|
405
|
+
"correctCode": "<Tour :visible=\"showTour\" @finish=\"showTour = false\" />",
|
|
406
|
+
"explanation": "需要通过响应式变量和 finish 事件控制显示隐藏",
|
|
407
|
+
"relatedProps": [
|
|
408
|
+
"visible"
|
|
409
|
+
]
|
|
222
410
|
},
|
|
223
411
|
{
|
|
224
|
-
|
|
225
|
-
|
|
412
|
+
"id": "tour_step_index",
|
|
413
|
+
"description": "步骤索引从 1 开始",
|
|
414
|
+
"wrongCode": "const currentStep = ref(1); // 期望从第一步开始",
|
|
415
|
+
"correctCode": "const currentStep = ref(0); // 第一步索引为 0",
|
|
416
|
+
"explanation": "步骤索引从 0 开始,0 表示第一步",
|
|
417
|
+
"relatedProps": [
|
|
418
|
+
"value"
|
|
419
|
+
]
|
|
226
420
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"
|
|
246
|
-
|
|
247
|
-
],
|
|
248
|
-
"usedProps": [
|
|
249
|
-
"value",
|
|
250
|
-
"visible",
|
|
251
|
-
"data"
|
|
252
|
-
],
|
|
253
|
-
"usedEvents": [
|
|
254
|
-
"finish"
|
|
255
|
-
],
|
|
256
|
-
"usedMethods": [],
|
|
257
|
-
"scenario": "创建基本的新手引导"
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
"id": "tour_declarative",
|
|
261
|
-
"title": "声明式步骤",
|
|
262
|
-
"description": "使用 TourStep 子组件定义步骤",
|
|
263
|
-
"difficulty": "medium",
|
|
264
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Tour, TourStep, Button } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\n\nconst startTour = () => {\n showTour.value = true;\n currentStep.value = 0;\n};\n\nconst closeTour = () => {\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Button id=\"btn1\">元素1</Button>\n <Button id=\"btn2\" style=\"margin-left: 20px;\">元素2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" @finish=\"closeTour\">\n <TourStep target=\"#btn1\" title=\"第一步\" content=\"第一步说明\" position=\"left\" />\n <TourStep target=\"#btn2\" title=\"第二步\" position=\"top\">第二步说明</TourStep>\n </Tour>\n <Button @click=\"startTour\">启动引导</Button>\n </div>\n</template>",
|
|
265
|
-
"tags": [
|
|
266
|
-
"declarative",
|
|
267
|
-
"TourStep"
|
|
268
|
-
],
|
|
269
|
-
"usedProps": [
|
|
270
|
-
"value",
|
|
271
|
-
"visible"
|
|
272
|
-
],
|
|
273
|
-
"usedEvents": [
|
|
274
|
-
"finish"
|
|
275
|
-
],
|
|
276
|
-
"usedMethods": [],
|
|
277
|
-
"scenario": "使用声明式方式定义引导步骤"
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
"id": "tour_events",
|
|
281
|
-
"title": "步骤事件",
|
|
282
|
-
"description": "监听步骤切换事件",
|
|
283
|
-
"difficulty": "medium",
|
|
284
|
-
"code": "<script setup lang=\"ts\">\nimport { ref, reactive } from 'vue';\nimport { Tour, Button, Message } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\nconst tourData = reactive([\n { target: '#btn1', title: '第一步', content: '点击下一步触发 next 事件' },\n { target: '#btn2', title: '第二步', content: '点击完成触发 finish 事件' }\n]);\n\nconst handleNext = (index: number) => {\n Message.info(`下一步,当前索引: ${index}`);\n};\n\nconst handleFinish = () => {\n Message.success('引导完成!');\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Button id=\"btn1\">步骤1</Button>\n <Button id=\"btn2\">步骤2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" :data=\"tourData\" \n @next=\"handleNext\" @finish=\"handleFinish\" />\n </div>\n</template>",
|
|
285
|
-
"tags": [
|
|
286
|
-
"events",
|
|
287
|
-
"next",
|
|
288
|
-
"finish"
|
|
289
|
-
],
|
|
290
|
-
"usedProps": [
|
|
291
|
-
"value",
|
|
292
|
-
"visible",
|
|
293
|
-
"data"
|
|
294
|
-
],
|
|
295
|
-
"usedEvents": [
|
|
296
|
-
"next",
|
|
297
|
-
"finish"
|
|
298
|
-
],
|
|
299
|
-
"usedMethods": [],
|
|
300
|
-
"scenario": "监听步骤切换事件"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"id": "tour_beforechange",
|
|
304
|
-
"title": "步骤验证",
|
|
305
|
-
"description": "切换前进行验证",
|
|
306
|
-
"difficulty": "hard",
|
|
307
|
-
"code": "<script setup lang=\"ts\">\nimport { ref, reactive } from 'vue';\nimport { Tour, Button, Message } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\nconst tourData = reactive([\n { target: '#step1', title: '第一步', content: '点击下一步进行验证' },\n { target: '#step2', title: '第二步', content: '验证通过后到达这里' }\n]);\n\nconst handleBeforeChange = async (current: number): Promise<boolean> => {\n if (current === 0) {\n Message.info('正在验证...');\n await new Promise(r => setTimeout(r, 1000));\n Message.success('验证通过!');\n return true;\n }\n return true;\n};\n</script>\n<template>\n <div>\n <Button id=\"step1\">步骤1</Button>\n <Button id=\"step2\">步骤2</Button>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" :data=\"tourData\" \n :beforeChange=\"handleBeforeChange\" />\n </div>\n</template>",
|
|
308
|
-
"tags": [
|
|
309
|
-
"beforeChange",
|
|
310
|
-
"validation",
|
|
311
|
-
"async"
|
|
312
|
-
],
|
|
313
|
-
"usedProps": [
|
|
314
|
-
"value",
|
|
315
|
-
"visible",
|
|
316
|
-
"data",
|
|
317
|
-
"beforeChange"
|
|
318
|
-
],
|
|
319
|
-
"usedEvents": [],
|
|
320
|
-
"usedMethods": [],
|
|
321
|
-
"scenario": "步骤切换前进行异步验证"
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
"id": "tour_center",
|
|
325
|
-
"title": "居中引导",
|
|
326
|
-
"description": "无目标元素的居中显示",
|
|
327
|
-
"difficulty": "easy",
|
|
328
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Tour, TourStep, Button } from '@king-design/vue';\n\nconst currentStep = ref(0);\nconst showTour = ref(false);\n\nconst startTour = () => {\n showTour.value = true;\n currentStep.value = 0;\n};\n\nconst closeTour = () => {\n showTour.value = false;\n};\n</script>\n<template>\n <div>\n <Tour v-model=\"currentStep\" :visible=\"showTour\" @finish=\"closeTour\">\n <TourStep title=\"欢迎页面\">\n <span>没有指定目标元素时,引导弹窗会居中显示。</span>\n </TourStep>\n <TourStep title=\"功能介绍\">\n <span>适合用于展示全局性的引导说明。</span>\n </TourStep>\n </Tour>\n <Button @click=\"startTour\">启动无目标引导</Button>\n </div>\n</template>",
|
|
329
|
-
"tags": [
|
|
330
|
-
"center",
|
|
331
|
-
"noTarget"
|
|
332
|
-
],
|
|
333
|
-
"usedProps": [
|
|
334
|
-
"value",
|
|
335
|
-
"visible"
|
|
336
|
-
],
|
|
337
|
-
"usedEvents": [
|
|
338
|
-
"finish"
|
|
339
|
-
],
|
|
340
|
-
"usedMethods": [],
|
|
341
|
-
"scenario": "无目标元素的居中显示引导"
|
|
342
|
-
}
|
|
343
|
-
],
|
|
344
|
-
"commonMistakes": [
|
|
345
|
-
{
|
|
346
|
-
"id": "tour_target_selector",
|
|
347
|
-
"description": "target 选择器未匹配到元素",
|
|
348
|
-
"wrongCode": "<TourStep target=\"btn1\" /> <!-- 缺少 # -->",
|
|
349
|
-
"correctCode": "<TourStep target=\"#btn1\" />",
|
|
350
|
-
"explanation": "target 使用 CSS 选择器,ID 选择器需要加 # 前缀",
|
|
351
|
-
"relatedProps": [
|
|
352
|
-
"target"
|
|
353
|
-
]
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
"id": "tour_visible_control",
|
|
357
|
-
"description": "未正确控制 visible 状态",
|
|
358
|
-
"wrongCode": "<Tour :visible=\"true\" /> <!-- 无法关闭 -->",
|
|
359
|
-
"correctCode": "<Tour :visible=\"showTour\" @finish=\"showTour = false\" />",
|
|
360
|
-
"explanation": "需要通过响应式变量和 finish 事件控制显示隐藏",
|
|
361
|
-
"relatedProps": [
|
|
362
|
-
"visible"
|
|
363
|
-
]
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
"id": "tour_step_index",
|
|
367
|
-
"description": "步骤索引从 1 开始",
|
|
368
|
-
"wrongCode": "const currentStep = ref(1); // 期望从第一步开始",
|
|
369
|
-
"correctCode": "const currentStep = ref(0); // 第一步索引为 0",
|
|
370
|
-
"explanation": "步骤索引从 0 开始,0 表示第一步",
|
|
371
|
-
"relatedProps": [
|
|
372
|
-
"value"
|
|
373
|
-
]
|
|
374
|
-
}
|
|
375
|
-
],
|
|
376
|
-
"searchKeywords": [
|
|
377
|
-
"引导",
|
|
378
|
-
"tour",
|
|
379
|
-
"新手引导",
|
|
380
|
-
"向导",
|
|
381
|
-
"导览",
|
|
382
|
-
"教程"
|
|
383
|
-
],
|
|
384
|
-
"useCases": [
|
|
385
|
-
"新手引导",
|
|
386
|
-
"功能介绍",
|
|
387
|
-
"产品导览",
|
|
388
|
-
"操作教程",
|
|
389
|
-
"更新公告"
|
|
390
|
-
],
|
|
391
|
-
"relatedComponents": [
|
|
392
|
-
"TourStep",
|
|
393
|
-
"Steps"
|
|
394
|
-
]
|
|
421
|
+
],
|
|
422
|
+
"searchKeywords": [
|
|
423
|
+
"引导",
|
|
424
|
+
"tour",
|
|
425
|
+
"新手引导",
|
|
426
|
+
"向导",
|
|
427
|
+
"导览",
|
|
428
|
+
"教程"
|
|
429
|
+
],
|
|
430
|
+
"useCases": [
|
|
431
|
+
"新手引导",
|
|
432
|
+
"功能介绍",
|
|
433
|
+
"产品导览",
|
|
434
|
+
"操作教程",
|
|
435
|
+
"更新公告"
|
|
436
|
+
],
|
|
437
|
+
"relatedComponents": [
|
|
438
|
+
"TourStep",
|
|
439
|
+
"Steps"
|
|
440
|
+
]
|
|
395
441
|
}
|