king-design-analyzer 1.0.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/README.md +151 -0
- package/components/affix.json +178 -0
- package/components/az.json +86 -0
- package/components/badge.json +162 -0
- package/components/billtypes.json +90 -0
- package/components/breadcrumb.json +220 -0
- package/components/button.json +511 -0
- package/components/card.json +334 -0
- package/components/cardcontent.json +144 -0
- package/components/carousel.json +207 -0
- package/components/cascader.json +373 -0
- package/components/checkbox.json +298 -0
- package/components/code.json +318 -0
- package/components/collapse.json +358 -0
- package/components/copy.json +220 -0
- package/components/datepicker.json +529 -0
- package/components/descriptions.json +309 -0
- package/components/dialog.json +460 -0
- package/components/divider.json +287 -0
- package/components/drawer.json +563 -0
- package/components/dropdown.json +407 -0
- package/components/editable.json +331 -0
- package/components/ellipsis.json +218 -0
- package/components/form.json +638 -0
- package/components/grid.json +377 -0
- package/components/icon.json +442 -0
- package/components/input.json +821 -0
- package/components/layoutcontent.json +210 -0
- package/components/menu.json +482 -0
- package/components/message.json +345 -0
- package/components/pagination.json +444 -0
- package/components/paginationplus.json +74 -0
- package/components/popover.json +456 -0
- package/components/progress.json +354 -0
- package/components/protable.json +132 -0
- package/components/radio.json +246 -0
- package/components/region.json +115 -0
- package/components/select.json +676 -0
- package/components/slider.json +422 -0
- package/components/spin.json +232 -0
- package/components/spinner.json +441 -0
- package/components/status.json +75 -0
- package/components/steps.json +292 -0
- package/components/switch.json +357 -0
- package/components/table.json +1057 -0
- package/components/tablecolumnid.json +217 -0
- package/components/tabs.json +363 -0
- package/components/tag.json +504 -0
- package/components/timepicker.json +447 -0
- package/components/tip.json +322 -0
- package/components/tooltip.json +416 -0
- package/components/tour.json +395 -0
- package/components/transfer.json +414 -0
- package/components/tree.json +480 -0
- package/components/treeselect.json +478 -0
- package/components/upload.json +499 -0
- package/components/virtuallist.json +178 -0
- package/dist/ast/index.d.mts +71 -0
- package/dist/ast/index.d.ts +71 -0
- package/dist/ast/index.js +15 -0
- package/dist/ast/index.mjs +2 -0
- package/dist/chunk-4BUGNH4F.mjs +62 -0
- package/dist/chunk-5H7N2A5X.mjs +1 -0
- package/dist/chunk-5IF32MBB.js +603 -0
- package/dist/chunk-ARWRNWDW.js +219 -0
- package/dist/chunk-C3L4IXJC.mjs +577 -0
- package/dist/chunk-GNVCC37B.js +102 -0
- package/dist/chunk-N4UIA6DN.js +68 -0
- package/dist/chunk-RAMIBZAU.mjs +216 -0
- package/dist/chunk-RNQHI7YG.js +64 -0
- package/dist/chunk-TB6BF5TJ.mjs +99 -0
- package/dist/chunk-UX7KGX45.mjs +66 -0
- package/dist/chunk-YTEYDSDW.js +2 -0
- package/dist/full/index.d.mts +29 -0
- package/dist/full/index.d.ts +29 -0
- package/dist/full/index.js +16 -0
- package/dist/full/index.mjs +3 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +43 -0
- package/dist/index.mjs +6 -0
- package/dist/runtime/index.d.mts +14 -0
- package/dist/runtime/index.d.ts +14 -0
- package/dist/runtime/index.js +15 -0
- package/dist/runtime/index.mjs +2 -0
- package/dist/sfcCompiler-m51JOfWs.d.mts +22 -0
- package/dist/sfcCompiler-m51JOfWs.d.ts +22 -0
- package/dist/static/index.d.mts +14 -0
- package/dist/static/index.d.ts +14 -0
- package/dist/static/index.js +19 -0
- package/dist/static/index.mjs +2 -0
- package/package.json +88 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
{
|
|
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": [
|
|
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\">"
|
|
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\">"
|
|
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\">"
|
|
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\">"
|
|
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>"
|
|
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\">"
|
|
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=\"结束引导\">"
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
"events": [
|
|
89
|
+
{
|
|
90
|
+
"name": "prev",
|
|
91
|
+
"vueEventName": "@prev",
|
|
92
|
+
"description": "点击上一步按钮时触发",
|
|
93
|
+
"payload": [
|
|
94
|
+
{
|
|
95
|
+
"name": "index",
|
|
96
|
+
"type": "number",
|
|
97
|
+
"description": "当前步骤索引"
|
|
98
|
+
}
|
|
99
|
+
],
|
|
100
|
+
"usageExample": "<Tour @prev=\"handlePrev\">",
|
|
101
|
+
"handlerExample": "const handlePrev = (index: number) => {\n console.log(`从步骤 ${index} 返回`);\n};"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "next",
|
|
105
|
+
"vueEventName": "@next",
|
|
106
|
+
"description": "点击下一步按钮时触发",
|
|
107
|
+
"payload": [
|
|
108
|
+
{
|
|
109
|
+
"name": "index",
|
|
110
|
+
"type": "number",
|
|
111
|
+
"description": "当前步骤索引"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"usageExample": "<Tour @next=\"handleNext\">",
|
|
115
|
+
"handlerExample": "const handleNext = (index: number) => {\n console.log(`从步骤 ${index} 前进`);\n};"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "finish",
|
|
119
|
+
"vueEventName": "@finish",
|
|
120
|
+
"description": "引导完成或关闭时触发",
|
|
121
|
+
"payload": [],
|
|
122
|
+
"usageExample": "<Tour @finish=\"handleFinish\">",
|
|
123
|
+
"handlerExample": "const handleFinish = () => {\n showTour.value = false;\n console.log('引导完成');\n};"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"methods": [],
|
|
127
|
+
"subComponents": [
|
|
128
|
+
{
|
|
129
|
+
"name": "TourStep",
|
|
130
|
+
"description": "引导步骤组件,用于定义每个引导步骤的内容",
|
|
131
|
+
"props": [
|
|
132
|
+
{
|
|
133
|
+
"name": "target",
|
|
134
|
+
"description": "目标元素,可以是 CSS 选择器或 DOM 元素。不指定则居中显示",
|
|
135
|
+
"type": {
|
|
136
|
+
"raw": "string | HTMLElement",
|
|
137
|
+
"kind": "union"
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"default": "undefined",
|
|
141
|
+
"usageExample": "<TourStep target=\"#btn1\">"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "title",
|
|
145
|
+
"description": "步骤标题",
|
|
146
|
+
"type": {
|
|
147
|
+
"raw": "string | VNode",
|
|
148
|
+
"kind": "union"
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"default": "undefined",
|
|
152
|
+
"usageExample": "<TourStep title=\"第一步\">"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "content",
|
|
156
|
+
"description": "步骤内容",
|
|
157
|
+
"type": {
|
|
158
|
+
"raw": "string | VNode",
|
|
159
|
+
"kind": "union"
|
|
160
|
+
},
|
|
161
|
+
"required": false,
|
|
162
|
+
"default": "undefined",
|
|
163
|
+
"usageExample": "<TourStep content=\"这是引导说明\">"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"name": "position",
|
|
167
|
+
"description": "弹出位置",
|
|
168
|
+
"type": {
|
|
169
|
+
"raw": "\"top\" | \"right\" | \"bottom\" | \"left\"",
|
|
170
|
+
"kind": "union"
|
|
171
|
+
},
|
|
172
|
+
"required": false,
|
|
173
|
+
"default": "\"bottom\"",
|
|
174
|
+
"allowedValues": [
|
|
175
|
+
{
|
|
176
|
+
"value": "top",
|
|
177
|
+
"label": "上方"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"value": "right",
|
|
181
|
+
"label": "右侧"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"value": "bottom",
|
|
185
|
+
"label": "下方",
|
|
186
|
+
"isDefault": true
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"value": "left",
|
|
190
|
+
"label": "左侧"
|
|
191
|
+
}
|
|
192
|
+
],
|
|
193
|
+
"usageExample": "<TourStep position=\"top\">"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "nextText",
|
|
197
|
+
"description": "下一步按钮文本",
|
|
198
|
+
"type": {
|
|
199
|
+
"raw": "string",
|
|
200
|
+
"kind": "string"
|
|
201
|
+
},
|
|
202
|
+
"required": false,
|
|
203
|
+
"default": "\"下一步\"",
|
|
204
|
+
"usageExample": "<TourStep nextText=\"继续\">"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "prevText",
|
|
208
|
+
"description": "上一步按钮文本",
|
|
209
|
+
"type": {
|
|
210
|
+
"raw": "string",
|
|
211
|
+
"kind": "string"
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"default": "\"上一步\"",
|
|
215
|
+
"usageExample": "<TourStep prevText=\"返回\">"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"slots": [
|
|
219
|
+
{
|
|
220
|
+
"name": "title",
|
|
221
|
+
"description": "自定义标题内容"
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"name": "footer",
|
|
225
|
+
"description": "自定义底部内容"
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
],
|
|
230
|
+
"typeDefinitions": [
|
|
231
|
+
{
|
|
232
|
+
"name": "TourStepData",
|
|
233
|
+
"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}",
|
|
234
|
+
"description": "步骤数据配置"
|
|
235
|
+
}
|
|
236
|
+
],
|
|
237
|
+
"examples": [
|
|
238
|
+
{
|
|
239
|
+
"id": "tour_basic",
|
|
240
|
+
"title": "基础用法",
|
|
241
|
+
"description": "使用 data 属性定义引导步骤",
|
|
242
|
+
"difficulty": "medium",
|
|
243
|
+
"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>",
|
|
244
|
+
"tags": [
|
|
245
|
+
"basic",
|
|
246
|
+
"data"
|
|
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
|
+
]
|
|
395
|
+
}
|