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,246 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "radio",
|
|
3
|
+
"name": "Radio",
|
|
4
|
+
"displayName": "单选框",
|
|
5
|
+
"category": "form",
|
|
6
|
+
"description": "单选框组件,用于在多个互斥选项中选择一个。可以通过 v-model 绑定同一个变量,以及指定相同的 name 来组成单选框组。",
|
|
7
|
+
"importStatement": "import { Radio } from '@king-design/vue';",
|
|
8
|
+
"props": [
|
|
9
|
+
{
|
|
10
|
+
"name": "value",
|
|
11
|
+
"description": "单选框取值,用于 v-model 进行双向绑定",
|
|
12
|
+
"type": {
|
|
13
|
+
"raw": "any",
|
|
14
|
+
"kind": "custom"
|
|
15
|
+
},
|
|
16
|
+
"required": false,
|
|
17
|
+
"default": "false",
|
|
18
|
+
"usageExample": "<Radio v-model=\"selected\" trueValue=\"a\">选项 A</Radio>"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "trueValue",
|
|
22
|
+
"description": "单选框选中后的值,用于区分不同选项",
|
|
23
|
+
"type": {
|
|
24
|
+
"raw": "any",
|
|
25
|
+
"kind": "custom"
|
|
26
|
+
},
|
|
27
|
+
"required": false,
|
|
28
|
+
"default": "true",
|
|
29
|
+
"usageExample": "<Radio v-model=\"selected\" trueValue=\"apple\">苹果</Radio>"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "disabled",
|
|
33
|
+
"description": "是否禁用",
|
|
34
|
+
"type": {
|
|
35
|
+
"raw": "boolean",
|
|
36
|
+
"kind": "boolean"
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"default": "false",
|
|
40
|
+
"usageExample": "<Radio disabled>禁用选项</Radio>"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "name",
|
|
44
|
+
"description": "单选框的名称。指定相同的 name 可以使多个单选框组成一个单选框组,行为与浏览器原生单选框一致。",
|
|
45
|
+
"type": {
|
|
46
|
+
"raw": "string",
|
|
47
|
+
"kind": "string"
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"default": "undefined",
|
|
51
|
+
"usageExample": "<Radio name=\"gender\" trueValue=\"male\">男</Radio>\n<Radio name=\"gender\" trueValue=\"female\">女</Radio>"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"events": [
|
|
55
|
+
{
|
|
56
|
+
"name": "change",
|
|
57
|
+
"vueEventName": "@change",
|
|
58
|
+
"description": "当点击组件导致值变化时触发",
|
|
59
|
+
"payload": [
|
|
60
|
+
{
|
|
61
|
+
"name": "value",
|
|
62
|
+
"type": "any",
|
|
63
|
+
"description": "当前选中的值"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "e",
|
|
67
|
+
"type": "MouseEvent",
|
|
68
|
+
"description": "原生鼠标事件对象"
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"usageExample": "<Radio @change=\"handleChange\" trueValue=\"a\">选项</Radio>",
|
|
72
|
+
"handlerExample": "const handleChange = (value: any, e: MouseEvent) => {\n console.log('选中值:', value);\n};"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"methods": [],
|
|
76
|
+
"examples": [
|
|
77
|
+
{
|
|
78
|
+
"id": "radio_basic",
|
|
79
|
+
"title": "基础用法",
|
|
80
|
+
"description": "基本的单选框组",
|
|
81
|
+
"difficulty": "easy",
|
|
82
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio } from '@king-design/vue';\n\nconst selected = ref('a');\n</script>\n<template>\n <Radio v-model=\"selected\" trueValue=\"a\">选项 A</Radio>\n <Radio v-model=\"selected\" trueValue=\"b\">选项 B</Radio>\n <Radio v-model=\"selected\" trueValue=\"c\">选项 C</Radio>\n</template>",
|
|
83
|
+
"tags": [
|
|
84
|
+
"basic",
|
|
85
|
+
"group"
|
|
86
|
+
],
|
|
87
|
+
"usedProps": [
|
|
88
|
+
"value",
|
|
89
|
+
"trueValue"
|
|
90
|
+
],
|
|
91
|
+
"usedEvents": [],
|
|
92
|
+
"usedMethods": [],
|
|
93
|
+
"scenario": "创建一组互斥的单选框"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "radio_disabled",
|
|
97
|
+
"title": "禁用状态",
|
|
98
|
+
"description": "禁用特定的单选框",
|
|
99
|
+
"difficulty": "easy",
|
|
100
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio } from '@king-design/vue';\n\nconst selected = ref('a');\n</script>\n<template>\n <Radio v-model=\"selected\" trueValue=\"a\">可选</Radio>\n <Radio v-model=\"selected\" trueValue=\"b\" disabled>禁用</Radio>\n</template>",
|
|
101
|
+
"tags": [
|
|
102
|
+
"disabled"
|
|
103
|
+
],
|
|
104
|
+
"usedProps": [
|
|
105
|
+
"value",
|
|
106
|
+
"trueValue",
|
|
107
|
+
"disabled"
|
|
108
|
+
],
|
|
109
|
+
"usedEvents": [],
|
|
110
|
+
"usedMethods": [],
|
|
111
|
+
"scenario": "禁用某些单选选项"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "radio_change_event",
|
|
115
|
+
"title": "监听变化",
|
|
116
|
+
"description": "监听单选框变化事件",
|
|
117
|
+
"difficulty": "easy",
|
|
118
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio, Message } from '@king-design/vue';\n\nconst selected = ref('');\n\nconst handleChange = (value: string) => {\n Message.info(`选中了: ${value}`);\n};\n</script>\n<template>\n <Radio v-model=\"selected\" trueValue=\"yes\" @change=\"handleChange\">是</Radio>\n <Radio v-model=\"selected\" trueValue=\"no\" @change=\"handleChange\">否</Radio>\n</template>",
|
|
119
|
+
"tags": [
|
|
120
|
+
"change",
|
|
121
|
+
"event"
|
|
122
|
+
],
|
|
123
|
+
"usedProps": [
|
|
124
|
+
"value",
|
|
125
|
+
"trueValue"
|
|
126
|
+
],
|
|
127
|
+
"usedEvents": [
|
|
128
|
+
"change"
|
|
129
|
+
],
|
|
130
|
+
"usedMethods": [],
|
|
131
|
+
"scenario": "监听单选框选中状态的变化"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "radio_boolean",
|
|
135
|
+
"title": "布尔选择",
|
|
136
|
+
"description": "是/否类型的单选",
|
|
137
|
+
"difficulty": "easy",
|
|
138
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio } from '@king-design/vue';\n\nconst agree = ref(false);\n</script>\n<template>\n <Radio v-model=\"agree\" :trueValue=\"true\">同意协议</Radio>\n <p>当前状态: {{ agree ? '已同意' : '未同意' }}</p>\n</template>",
|
|
139
|
+
"tags": [
|
|
140
|
+
"boolean",
|
|
141
|
+
"agree"
|
|
142
|
+
],
|
|
143
|
+
"usedProps": [
|
|
144
|
+
"value",
|
|
145
|
+
"trueValue"
|
|
146
|
+
],
|
|
147
|
+
"usedEvents": [],
|
|
148
|
+
"usedMethods": [],
|
|
149
|
+
"scenario": "创建同意/拒绝类型的单选框"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "radio_fruit_selection",
|
|
153
|
+
"title": "水果选择",
|
|
154
|
+
"description": "实际场景:选择水果",
|
|
155
|
+
"difficulty": "easy",
|
|
156
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio } from '@king-design/vue';\n\nconst fruit = ref('apple');\n</script>\n<template>\n <div>\n <Radio v-model=\"fruit\" trueValue=\"apple\">🍎 苹果</Radio>\n <Radio v-model=\"fruit\" trueValue=\"orange\">🍊 橙子</Radio>\n <Radio v-model=\"fruit\" trueValue=\"banana\">🍌 香蕉</Radio>\n <Radio v-model=\"fruit\" trueValue=\"grape\">🍇 葡萄</Radio>\n </div>\n <p>您选择了: {{ fruit }}</p>\n</template>",
|
|
157
|
+
"tags": [
|
|
158
|
+
"selection",
|
|
159
|
+
"fruit"
|
|
160
|
+
],
|
|
161
|
+
"usedProps": [
|
|
162
|
+
"value",
|
|
163
|
+
"trueValue"
|
|
164
|
+
],
|
|
165
|
+
"usedEvents": [],
|
|
166
|
+
"usedMethods": [],
|
|
167
|
+
"scenario": "实际应用场景:商品选择"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"id": "radio_name_grouping",
|
|
171
|
+
"title": "原生 Name 分组",
|
|
172
|
+
"description": "通过指定相同的 name 属性使多个单选框组成一个单选框组(原生行为)",
|
|
173
|
+
"difficulty": "easy",
|
|
174
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Radio } from '@king-design/vue';\n\nconst gender = ref('');\n</script>\n<template>\n <div>\n <Radio name=\"gender\" trueValue=\"male\" v-model=\"gender\">男</Radio>\n <Radio name=\"gender\" trueValue=\"female\" v-model=\"gender\">女</Radio>\n </div>\n <p>选中性别: {{ gender }}</p>\n</template>",
|
|
175
|
+
"tags": [
|
|
176
|
+
"name",
|
|
177
|
+
"native",
|
|
178
|
+
"group"
|
|
179
|
+
],
|
|
180
|
+
"usedProps": [
|
|
181
|
+
"name",
|
|
182
|
+
"trueValue",
|
|
183
|
+
"value"
|
|
184
|
+
],
|
|
185
|
+
"usedEvents": [],
|
|
186
|
+
"usedMethods": [],
|
|
187
|
+
"scenario": "使用原生 name 属性进行单选框分组"
|
|
188
|
+
}
|
|
189
|
+
],
|
|
190
|
+
"commonMistakes": [
|
|
191
|
+
{
|
|
192
|
+
"id": "radio_missing_truevalue",
|
|
193
|
+
"description": "多个 Radio 未设置 trueValue",
|
|
194
|
+
"wrongCode": "<Radio v-model=\"selected\">选项 A</Radio>\n<Radio v-model=\"selected\">选项 B</Radio>",
|
|
195
|
+
"correctCode": "<Radio v-model=\"selected\" trueValue=\"a\">选项 A</Radio>\n<Radio v-model=\"selected\" trueValue=\"b\">选项 B</Radio>",
|
|
196
|
+
"explanation": "多个 Radio 组成单选组时,必须为每个 Radio 设置不同的 trueValue 来区分选项",
|
|
197
|
+
"relatedProps": [
|
|
198
|
+
"trueValue"
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"id": "radio_different_vmodel_no_name",
|
|
203
|
+
"description": "未设置 name 且同组 Radio 绑定了不同的 v-model",
|
|
204
|
+
"wrongCode": "<Radio v-model=\"value1\" trueValue=\"a\">A</Radio>\n<Radio v-model=\"value2\" trueValue=\"b\">B</Radio>",
|
|
205
|
+
"correctCode": "<Radio v-model=\"selected\" trueValue=\"a\">A</Radio>\n<Radio v-model=\"selected\" trueValue=\"b\">B</Radio>",
|
|
206
|
+
"explanation": "如果不使用 name 属性进行原生分组,同一组单选框必须绑定同一个 v-model 变量,否则无法实现互斥选择",
|
|
207
|
+
"relatedProps": [
|
|
208
|
+
"value"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"id": "radio_truevalue_same",
|
|
213
|
+
"description": "多个 Radio 设置了相同的 trueValue",
|
|
214
|
+
"wrongCode": "<Radio v-model=\"selected\" trueValue=\"a\">A</Radio>\n<Radio v-model=\"selected\" trueValue=\"a\">B</Radio>",
|
|
215
|
+
"correctCode": "<Radio v-model=\"selected\" trueValue=\"a\">A</Radio>\n<Radio v-model=\"selected\" trueValue=\"b\">B</Radio>",
|
|
216
|
+
"explanation": "同组中每个 Radio 的 trueValue 必须唯一,否则无法区分选项",
|
|
217
|
+
"relatedProps": [
|
|
218
|
+
"trueValue"
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
"searchKeywords": [
|
|
223
|
+
"单选框",
|
|
224
|
+
"radio",
|
|
225
|
+
"单选",
|
|
226
|
+
"选择",
|
|
227
|
+
"互斥",
|
|
228
|
+
"选项",
|
|
229
|
+
"trueValue",
|
|
230
|
+
"name",
|
|
231
|
+
"分组"
|
|
232
|
+
],
|
|
233
|
+
"useCases": [
|
|
234
|
+
"表单中的性别选择",
|
|
235
|
+
"是/否选择",
|
|
236
|
+
"支付方式选择",
|
|
237
|
+
"配送方式选择",
|
|
238
|
+
"等级/类型选择",
|
|
239
|
+
"问卷中的单选题"
|
|
240
|
+
],
|
|
241
|
+
"relatedComponents": [
|
|
242
|
+
"Checkbox",
|
|
243
|
+
"ButtonGroup",
|
|
244
|
+
"Select"
|
|
245
|
+
]
|
|
246
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "region",
|
|
3
|
+
"name": "Region",
|
|
4
|
+
"displayName": "地域选择",
|
|
5
|
+
"category": "form",
|
|
6
|
+
"description": "地域(Region)选择组件,支持多区域和多地域的展示与切换。",
|
|
7
|
+
"importStatement": "import { Region } from '@ksyun-internal/versatile';",
|
|
8
|
+
"props": [
|
|
9
|
+
{
|
|
10
|
+
"name": "modelValue",
|
|
11
|
+
"description": "选中的地域编码(RegionCode)",
|
|
12
|
+
"type": {
|
|
13
|
+
"raw": "string",
|
|
14
|
+
"kind": "string"
|
|
15
|
+
},
|
|
16
|
+
"required": false,
|
|
17
|
+
"usageExample": "<Region v-model=\"regionCode\" />"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "areaCode",
|
|
21
|
+
"description": "当前选中的大区编码",
|
|
22
|
+
"type": {
|
|
23
|
+
"raw": "string",
|
|
24
|
+
"kind": "string"
|
|
25
|
+
},
|
|
26
|
+
"required": false,
|
|
27
|
+
"usageExample": "<Region v-model:areaCode=\"areaCode\" />"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "packages",
|
|
31
|
+
"description": "地域配置列表",
|
|
32
|
+
"type": {
|
|
33
|
+
"raw": "Region[]",
|
|
34
|
+
"kind": "array"
|
|
35
|
+
},
|
|
36
|
+
"required": false,
|
|
37
|
+
"usageExample": "<Region :packages=\"packages\" />"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "supportEmptyAz",
|
|
41
|
+
"description": "是否支持空可用区",
|
|
42
|
+
"type": {
|
|
43
|
+
"raw": "boolean",
|
|
44
|
+
"kind": "boolean"
|
|
45
|
+
},
|
|
46
|
+
"required": false,
|
|
47
|
+
"default": "false",
|
|
48
|
+
"usageExample": "<Region supportEmptyAz />"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "showLearnMore",
|
|
52
|
+
"description": "是否显示了解更多",
|
|
53
|
+
"type": {
|
|
54
|
+
"raw": "boolean",
|
|
55
|
+
"kind": "boolean"
|
|
56
|
+
},
|
|
57
|
+
"required": false,
|
|
58
|
+
"default": "true",
|
|
59
|
+
"usageExample": "<Region showLearnMore />"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "learnMoreUrl",
|
|
63
|
+
"description": "了解更多链接ID",
|
|
64
|
+
"type": {
|
|
65
|
+
"raw": "number",
|
|
66
|
+
"kind": "number"
|
|
67
|
+
},
|
|
68
|
+
"required": false,
|
|
69
|
+
"usageExample": "<Region :learnMoreUrl=\"123\" />"
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"events": [
|
|
73
|
+
{
|
|
74
|
+
"name": "change",
|
|
75
|
+
"vueEventName": "update:modelValue",
|
|
76
|
+
"description": "地域改变时触发",
|
|
77
|
+
"payload": [
|
|
78
|
+
{
|
|
79
|
+
"name": "value",
|
|
80
|
+
"type": "string",
|
|
81
|
+
"description": "新的RegionCode"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"usageExample": "<Region @update:modelValue=\"v => console.log(v)\" />",
|
|
85
|
+
"handlerExample": "(val) => { console.log(val); }"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "areaChange",
|
|
89
|
+
"vueEventName": "update:areaCode",
|
|
90
|
+
"description": "大区改变时触发",
|
|
91
|
+
"payload": [
|
|
92
|
+
{
|
|
93
|
+
"name": "value",
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "新的AreaCode"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
"usageExample": "<Region @update:areaCode=\"v => console.log(v)\" />",
|
|
99
|
+
"handlerExample": "(val) => { console.log(val); }"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"methods": [],
|
|
103
|
+
"examples": [],
|
|
104
|
+
"searchKeywords": [
|
|
105
|
+
"region",
|
|
106
|
+
"area",
|
|
107
|
+
"location",
|
|
108
|
+
"地域",
|
|
109
|
+
"区域"
|
|
110
|
+
],
|
|
111
|
+
"useCases": [
|
|
112
|
+
"购买页选择地域",
|
|
113
|
+
"列表页筛选地域"
|
|
114
|
+
]
|
|
115
|
+
}
|