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/select.json
CHANGED
|
@@ -1,676 +1,696 @@
|
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
2
|
+
"id": "select",
|
|
3
|
+
"name": "Select",
|
|
4
|
+
"displayName": "选择框",
|
|
5
|
+
"category": "form",
|
|
6
|
+
"description": "下拉选择器组件,支持单选、多选、分组、搜索筛选、可创建新选项等功能。配合 Option 和 OptionGroup 子组件使用。",
|
|
7
|
+
"importStatement": "import { Select, Option, OptionGroup } 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": "\"\"",
|
|
18
|
+
"usageExample": "<Select v-model=\"selected\">"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "multiple",
|
|
22
|
+
"description": "是否支持多选",
|
|
23
|
+
"type": {
|
|
24
|
+
"raw": "boolean",
|
|
25
|
+
"kind": "boolean"
|
|
26
|
+
},
|
|
27
|
+
"required": false,
|
|
28
|
+
"default": "false",
|
|
29
|
+
"usageExample": "<Select v-model=\"selectedList\" multiple>"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "filterable",
|
|
33
|
+
"description": "是否支持筛选,输入时可过滤选项",
|
|
34
|
+
"type": {
|
|
35
|
+
"raw": "boolean",
|
|
36
|
+
"kind": "boolean"
|
|
37
|
+
},
|
|
38
|
+
"required": false,
|
|
39
|
+
"default": "false",
|
|
40
|
+
"usageExample": "<Select v-model=\"selected\" filterable>"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "loading",
|
|
44
|
+
"description": "数据加载状态",
|
|
45
|
+
"type": {
|
|
46
|
+
"raw": "boolean",
|
|
47
|
+
"kind": "boolean"
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"default": "false",
|
|
51
|
+
"usageExample": "<Select v-model=\"selected\" :loading=\"isLoading\">"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "disabled",
|
|
55
|
+
"description": "是否禁用",
|
|
56
|
+
"type": {
|
|
57
|
+
"raw": "boolean",
|
|
58
|
+
"kind": "boolean"
|
|
59
|
+
},
|
|
60
|
+
"required": false,
|
|
61
|
+
"default": "false",
|
|
62
|
+
"usageExample": "<Select disabled>"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "name",
|
|
66
|
+
"description": "表单元素的 name 属性",
|
|
67
|
+
"type": {
|
|
68
|
+
"raw": "string",
|
|
69
|
+
"kind": "string"
|
|
70
|
+
},
|
|
71
|
+
"required": false,
|
|
72
|
+
"default": "undefined",
|
|
73
|
+
"usageExample": "<Select name=\"city\">"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "size",
|
|
77
|
+
"description": "尺寸",
|
|
78
|
+
"type": {
|
|
79
|
+
"raw": "\"large\" | \"default\" | \"small\" | \"mini\"",
|
|
80
|
+
"kind": "union",
|
|
81
|
+
"unionTypes": [
|
|
82
|
+
"large",
|
|
83
|
+
"default",
|
|
84
|
+
"small",
|
|
85
|
+
"mini"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"default": "\"default\"",
|
|
90
|
+
"allowedValues": [
|
|
91
|
+
{
|
|
92
|
+
"value": "large",
|
|
93
|
+
"label": "大尺寸"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"value": "default",
|
|
97
|
+
"label": "默认尺寸",
|
|
98
|
+
"isDefault": true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"value": "small",
|
|
102
|
+
"label": "小尺寸"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"value": "mini",
|
|
106
|
+
"label": "迷你尺寸"
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
"usageExample": "<Select size=\"small\">"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"name": "hideIcon",
|
|
113
|
+
"description": "是否隐藏后面的下拉图标",
|
|
114
|
+
"type": {
|
|
115
|
+
"raw": "boolean",
|
|
116
|
+
"kind": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"required": false,
|
|
119
|
+
"default": "false",
|
|
120
|
+
"usageExample": "<Select hideIcon>"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "clearable",
|
|
124
|
+
"description": "是否可清空已选内容",
|
|
125
|
+
"type": {
|
|
126
|
+
"raw": "boolean",
|
|
127
|
+
"kind": "boolean"
|
|
128
|
+
},
|
|
129
|
+
"required": false,
|
|
130
|
+
"default": "false",
|
|
131
|
+
"usageExample": "<Select v-model=\"selected\" clearable>"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "fluid",
|
|
135
|
+
"description": "是否宽度 100%",
|
|
136
|
+
"type": {
|
|
137
|
+
"raw": "boolean",
|
|
138
|
+
"kind": "boolean"
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"default": "false",
|
|
142
|
+
"usageExample": "<Select fluid>"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"name": "inline",
|
|
146
|
+
"description": "展示内联模式,该模式下组件没有边框,宽度和高度由内容撑开",
|
|
147
|
+
"type": {
|
|
148
|
+
"raw": "boolean",
|
|
149
|
+
"kind": "boolean"
|
|
150
|
+
},
|
|
151
|
+
"required": false,
|
|
152
|
+
"default": "false",
|
|
153
|
+
"usageExample": "<Select inline>"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "placeholder",
|
|
157
|
+
"description": "占位文案",
|
|
158
|
+
"type": {
|
|
159
|
+
"raw": "string",
|
|
160
|
+
"kind": "string"
|
|
161
|
+
},
|
|
162
|
+
"required": false,
|
|
163
|
+
"default": "\"请选择\"",
|
|
164
|
+
"usageExample": "<Select placeholder=\"请选择城市\">"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "container",
|
|
168
|
+
"description": "指定弹出菜单追加的位置,默认 Dialog 组件会追加到 Dialog 中,其他追加到 body",
|
|
169
|
+
"type": {
|
|
170
|
+
"raw": "string | ((parentDom: Element, anchor: Node | null) => Element)",
|
|
171
|
+
"kind": "union"
|
|
172
|
+
},
|
|
173
|
+
"required": false,
|
|
174
|
+
"default": "undefined",
|
|
175
|
+
"usageExample": "<Select :container=\"() => document.body\">"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "width",
|
|
179
|
+
"description": "指定宽度,组件自动添加单位 px",
|
|
180
|
+
"type": {
|
|
181
|
+
"raw": "number | string",
|
|
182
|
+
"kind": "union"
|
|
183
|
+
},
|
|
184
|
+
"required": false,
|
|
185
|
+
"default": "undefined",
|
|
186
|
+
"usageExample": "<Select :width=\"200\">"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"name": "filter",
|
|
190
|
+
"description": "当支持筛选时,可以自定义筛选规则",
|
|
191
|
+
"type": {
|
|
192
|
+
"raw": "(keywords: string, props: any) => boolean",
|
|
193
|
+
"kind": "function",
|
|
194
|
+
"functionSignature": "(keywords: string, props: any) => boolean"
|
|
195
|
+
},
|
|
196
|
+
"required": false,
|
|
197
|
+
"default": "(keywords, props) => props.label.toLowerCase().includes(keywords) || props.value.toLowerCase().includes(keywords)",
|
|
198
|
+
"usageExample": "<Select filterable :filter=\"(kw, props) => props.label.includes(kw)\">"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"name": "searchable",
|
|
202
|
+
"description": "是否在弹出菜单中展示搜索框",
|
|
203
|
+
"type": {
|
|
204
|
+
"raw": "boolean",
|
|
205
|
+
"kind": "boolean"
|
|
206
|
+
},
|
|
207
|
+
"required": false,
|
|
208
|
+
"default": "false",
|
|
209
|
+
"usageExample": "<Select searchable>"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"name": "creatable",
|
|
213
|
+
"description": "是否支持创建新的选项,可以配合 filterable 使用",
|
|
214
|
+
"type": {
|
|
215
|
+
"raw": "boolean",
|
|
216
|
+
"kind": "boolean"
|
|
217
|
+
},
|
|
218
|
+
"required": false,
|
|
219
|
+
"default": "false",
|
|
220
|
+
"usageExample": "<Select filterable creatable>"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "labelMap",
|
|
224
|
+
"description": "建立 value 到 label 的映射,可以在 value 不在 Option 集合中时正确展示 label",
|
|
225
|
+
"type": {
|
|
226
|
+
"raw": "Map<any, string>",
|
|
227
|
+
"kind": "object"
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"default": "new Map()",
|
|
231
|
+
"usageExample": "<Select :labelMap=\"new Map([['custom', '自定义选项']])\">"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "card",
|
|
235
|
+
"description": "是否展示 card 模式",
|
|
236
|
+
"type": {
|
|
237
|
+
"raw": "boolean",
|
|
238
|
+
"kind": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"required": false,
|
|
241
|
+
"default": "false",
|
|
242
|
+
"usageExample": "<Select card>"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "autoDisableArrow",
|
|
246
|
+
"description": "是否在没有更多可选项时,给箭头一个 disabled 状态来提示用户",
|
|
247
|
+
"type": {
|
|
248
|
+
"raw": "boolean",
|
|
249
|
+
"kind": "boolean"
|
|
250
|
+
},
|
|
251
|
+
"required": false,
|
|
252
|
+
"default": "false",
|
|
253
|
+
"usageExample": "<Select autoDisableArrow>"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
"name": "keepKeywords",
|
|
257
|
+
"description": "是否在选中选项后保留搜索关键字,配合 filterable 使用",
|
|
258
|
+
"type": {
|
|
259
|
+
"raw": "boolean",
|
|
260
|
+
"kind": "boolean"
|
|
261
|
+
},
|
|
262
|
+
"required": false,
|
|
263
|
+
"default": "true",
|
|
264
|
+
"usageExample": "<Select filterable :keepKeywords=\"false\">"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "show",
|
|
268
|
+
"description": "是否展示菜单项(受控模式)",
|
|
269
|
+
"type": {
|
|
270
|
+
"raw": "boolean",
|
|
271
|
+
"kind": "boolean"
|
|
272
|
+
},
|
|
273
|
+
"required": false,
|
|
274
|
+
"default": "false",
|
|
275
|
+
"usageExample": "<Select :show=\"isMenuVisible\">"
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
"name": "position",
|
|
279
|
+
"description": "菜单弹出的位置",
|
|
280
|
+
"type": {
|
|
281
|
+
"raw": "Position | \"left\" | \"bottom\" | \"right\" | \"top\"",
|
|
282
|
+
"kind": "union",
|
|
283
|
+
"unionTypes": [
|
|
284
|
+
"left",
|
|
285
|
+
"bottom",
|
|
286
|
+
"right",
|
|
287
|
+
"top"
|
|
288
|
+
]
|
|
289
|
+
},
|
|
290
|
+
"required": false,
|
|
291
|
+
"default": "{my: 'left top+8', at: 'left bottom'}",
|
|
292
|
+
"usageExample": "<Select position=\"top\">"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "flat",
|
|
296
|
+
"description": "是否展示扁平样式",
|
|
297
|
+
"type": {
|
|
298
|
+
"raw": "boolean",
|
|
299
|
+
"kind": "boolean"
|
|
300
|
+
},
|
|
301
|
+
"required": false,
|
|
302
|
+
"default": "false",
|
|
303
|
+
"usageExample": "<Select flat>"
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"name": "nowrap",
|
|
307
|
+
"description": "选中值区域是否不换行展示,适合单行紧凑布局",
|
|
308
|
+
"type": {
|
|
309
|
+
"raw": "boolean",
|
|
310
|
+
"kind": "boolean"
|
|
311
|
+
},
|
|
312
|
+
"required": false,
|
|
313
|
+
"default": "false",
|
|
314
|
+
"usageExample": "<Select nowrap>"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"name": "draggable",
|
|
318
|
+
"description": "多选值是否支持拖动排序",
|
|
319
|
+
"type": {
|
|
320
|
+
"raw": "boolean",
|
|
321
|
+
"kind": "boolean"
|
|
322
|
+
},
|
|
323
|
+
"required": false,
|
|
324
|
+
"default": "false",
|
|
325
|
+
"usageExample": "<Select multiple draggable>"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "virtual",
|
|
329
|
+
"description": "是否开启虚拟列表,用于大数据量场景",
|
|
330
|
+
"type": {
|
|
331
|
+
"raw": "boolean",
|
|
332
|
+
"kind": "boolean"
|
|
333
|
+
},
|
|
334
|
+
"required": false,
|
|
335
|
+
"default": "false",
|
|
336
|
+
"usageExample": "<Select virtual>"
|
|
107
337
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
"type": {
|
|
126
|
-
"raw": "boolean",
|
|
127
|
-
"kind": "boolean"
|
|
128
|
-
},
|
|
129
|
-
"required": false,
|
|
130
|
-
"default": "false",
|
|
131
|
-
"usageExample": "<Select v-model=\"selected\" clearable></Select>"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"name": "fluid",
|
|
135
|
-
"description": "是否宽度 100%",
|
|
136
|
-
"type": {
|
|
137
|
-
"raw": "boolean",
|
|
138
|
-
"kind": "boolean"
|
|
139
|
-
},
|
|
140
|
-
"required": false,
|
|
141
|
-
"default": "false",
|
|
142
|
-
"usageExample": "<Select fluid></Select>"
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
"name": "inline",
|
|
146
|
-
"description": "展示内联模式,该模式下组件没有边框,宽度和高度由内容撑开",
|
|
147
|
-
"type": {
|
|
148
|
-
"raw": "boolean",
|
|
149
|
-
"kind": "boolean"
|
|
150
|
-
},
|
|
151
|
-
"required": false,
|
|
152
|
-
"default": "false",
|
|
153
|
-
"usageExample": "<Select inline></Select>"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
"name": "placeholder",
|
|
157
|
-
"description": "占位文案",
|
|
158
|
-
"type": {
|
|
159
|
-
"raw": "string",
|
|
160
|
-
"kind": "string"
|
|
161
|
-
},
|
|
162
|
-
"required": false,
|
|
163
|
-
"default": "\"请选择\"",
|
|
164
|
-
"usageExample": "<Select placeholder=\"请选择城市\"></Select>"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"name": "container",
|
|
168
|
-
"description": "指定弹出菜单追加的位置,默认 Dialog 组件会追加到 Dialog 中,其他追加到 body",
|
|
169
|
-
"type": {
|
|
170
|
-
"raw": "string | ((parentDom: Element, anchor: Node | null) => Element)",
|
|
171
|
-
"kind": "union"
|
|
172
|
-
},
|
|
173
|
-
"required": false,
|
|
174
|
-
"default": "undefined",
|
|
175
|
-
"usageExample": "<Select :container=\"() => document.body\"></Select>"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
"name": "width",
|
|
179
|
-
"description": "指定宽度,组件自动添加单位 px",
|
|
180
|
-
"type": {
|
|
181
|
-
"raw": "number | string",
|
|
182
|
-
"kind": "union"
|
|
183
|
-
},
|
|
184
|
-
"required": false,
|
|
185
|
-
"default": "undefined",
|
|
186
|
-
"usageExample": "<Select :width=\"200\"></Select>"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"name": "filter",
|
|
190
|
-
"description": "当支持筛选时,可以自定义筛选规则",
|
|
191
|
-
"type": {
|
|
192
|
-
"raw": "(keywords: string, props: any) => boolean",
|
|
193
|
-
"kind": "function",
|
|
194
|
-
"functionSignature": "(keywords: string, props: any) => boolean"
|
|
195
|
-
},
|
|
196
|
-
"required": false,
|
|
197
|
-
"default": "(keywords, props) => props.label.toLowerCase().includes(keywords) || props.value.toLowerCase().includes(keywords)",
|
|
198
|
-
"usageExample": "<Select filterable :filter=\"(kw, props) => props.label.includes(kw)\"></Select>"
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
"name": "searchable",
|
|
202
|
-
"description": "是否在弹出菜单中展示搜索框",
|
|
203
|
-
"type": {
|
|
204
|
-
"raw": "boolean",
|
|
205
|
-
"kind": "boolean"
|
|
206
|
-
},
|
|
207
|
-
"required": false,
|
|
208
|
-
"default": "false",
|
|
209
|
-
"usageExample": "<Select searchable></Select>"
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
"name": "creatable",
|
|
213
|
-
"description": "是否支持创建新的选项,可以配合 filterable 使用",
|
|
214
|
-
"type": {
|
|
215
|
-
"raw": "boolean",
|
|
216
|
-
"kind": "boolean"
|
|
217
|
-
},
|
|
218
|
-
"required": false,
|
|
219
|
-
"default": "false",
|
|
220
|
-
"usageExample": "<Select filterable creatable></Select>"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
"name": "labelMap",
|
|
224
|
-
"description": "建立 value 到 label 的映射,可以在 value 不在 Option 集合中时正确展示 label",
|
|
225
|
-
"type": {
|
|
226
|
-
"raw": "Map<any, string>",
|
|
227
|
-
"kind": "object"
|
|
228
|
-
},
|
|
229
|
-
"required": false,
|
|
230
|
-
"default": "new Map()",
|
|
231
|
-
"usageExample": "<Select :labelMap=\"new Map([['custom', '自定义选项']])\"></Select>"
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
"name": "card",
|
|
235
|
-
"description": "是否展示 card 模式",
|
|
236
|
-
"type": {
|
|
237
|
-
"raw": "boolean",
|
|
238
|
-
"kind": "boolean"
|
|
239
|
-
},
|
|
240
|
-
"required": false,
|
|
241
|
-
"default": "false",
|
|
242
|
-
"usageExample": "<Select card></Select>"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
"name": "autoDisableArrow",
|
|
246
|
-
"description": "是否在没有更多可选项时,给箭头一个 disabled 状态来提示用户",
|
|
247
|
-
"type": {
|
|
248
|
-
"raw": "boolean",
|
|
249
|
-
"kind": "boolean"
|
|
250
|
-
},
|
|
251
|
-
"required": false,
|
|
252
|
-
"default": "false",
|
|
253
|
-
"usageExample": "<Select autoDisableArrow></Select>"
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
"name": "keepKeywords",
|
|
257
|
-
"description": "是否在选中选项后保留搜索关键字,配合 filterable 使用",
|
|
258
|
-
"type": {
|
|
259
|
-
"raw": "boolean",
|
|
260
|
-
"kind": "boolean"
|
|
261
|
-
},
|
|
262
|
-
"required": false,
|
|
263
|
-
"default": "true",
|
|
264
|
-
"usageExample": "<Select filterable :keepKeywords=\"false\"></Select>"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
"name": "show",
|
|
268
|
-
"description": "是否展示菜单项(受控模式)",
|
|
269
|
-
"type": {
|
|
270
|
-
"raw": "boolean",
|
|
271
|
-
"kind": "boolean"
|
|
272
|
-
},
|
|
273
|
-
"required": false,
|
|
274
|
-
"default": "false",
|
|
275
|
-
"usageExample": "<Select :show=\"isMenuVisible\"></Select>"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
"name": "position",
|
|
279
|
-
"description": "菜单弹出的位置",
|
|
280
|
-
"type": {
|
|
281
|
-
"raw": "Position | \"left\" | \"bottom\" | \"right\" | \"top\"",
|
|
282
|
-
"kind": "union",
|
|
283
|
-
"unionTypes": [
|
|
284
|
-
"left",
|
|
285
|
-
"bottom",
|
|
286
|
-
"right",
|
|
287
|
-
"top"
|
|
288
|
-
]
|
|
289
|
-
},
|
|
290
|
-
"required": false,
|
|
291
|
-
"default": "{my: 'left top+8', at: 'left bottom'}",
|
|
292
|
-
"usageExample": "<Select position=\"top\"></Select>"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
"name": "flat",
|
|
296
|
-
"description": "是否展示扁平样式",
|
|
297
|
-
"type": {
|
|
298
|
-
"raw": "boolean",
|
|
299
|
-
"kind": "boolean"
|
|
300
|
-
},
|
|
301
|
-
"required": false,
|
|
302
|
-
"default": "false",
|
|
303
|
-
"usageExample": "<Select flat></Select>"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
"name": "draggable",
|
|
307
|
-
"description": "多选值是否支持拖动排序",
|
|
308
|
-
"type": {
|
|
309
|
-
"raw": "boolean",
|
|
310
|
-
"kind": "boolean"
|
|
311
|
-
},
|
|
312
|
-
"required": false,
|
|
313
|
-
"default": "false",
|
|
314
|
-
"usageExample": "<Select multiple draggable></Select>"
|
|
315
|
-
},
|
|
316
|
-
{
|
|
317
|
-
"name": "virtual",
|
|
318
|
-
"description": "是否开启虚拟列表,用于大数据量场景",
|
|
319
|
-
"type": {
|
|
320
|
-
"raw": "boolean",
|
|
321
|
-
"kind": "boolean"
|
|
322
|
-
},
|
|
323
|
-
"required": false,
|
|
324
|
-
"default": "false",
|
|
325
|
-
"usageExample": "<Select virtual></Select>"
|
|
326
|
-
}
|
|
327
|
-
],
|
|
328
|
-
"events": [
|
|
329
|
-
{
|
|
330
|
-
"name": "show",
|
|
331
|
-
"vueEventName": "@show",
|
|
332
|
-
"description": "菜单弹出时触发",
|
|
333
|
-
"payload": [],
|
|
334
|
-
"usageExample": "<Select @show=\"handleShow\"></Select>",
|
|
335
|
-
"handlerExample": "const handleShow = () => {\n console.log('下拉菜单已展开');\n};"
|
|
336
|
-
},
|
|
337
|
-
{
|
|
338
|
-
"name": "hide",
|
|
339
|
-
"vueEventName": "@hide",
|
|
340
|
-
"description": "菜单隐藏时触发",
|
|
341
|
-
"payload": [],
|
|
342
|
-
"usageExample": "<Select @hide=\"handleHide\"></Select>",
|
|
343
|
-
"handlerExample": "const handleHide = () => {\n console.log('下拉菜单已关闭');\n};"
|
|
344
|
-
}
|
|
345
|
-
],
|
|
346
|
-
"slots": [
|
|
347
|
-
{
|
|
348
|
-
"name": "value",
|
|
349
|
-
"description": "自定义选择结果的展示",
|
|
350
|
-
"params": "([value: any, label: Children]) => Children"
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
"name": "values",
|
|
354
|
-
"description": "自定义多选的选择结果的展示",
|
|
355
|
-
"params": "([values: any[], labels: Children[]]) => Children"
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
"name": "prefix",
|
|
359
|
-
"description": "自定义输入框前面展示的内容"
|
|
360
|
-
},
|
|
361
|
-
{
|
|
362
|
-
"name": "suffix",
|
|
363
|
-
"description": "自定义输入框后面展示的内容"
|
|
364
|
-
},
|
|
365
|
-
{
|
|
366
|
-
"name": "menu",
|
|
367
|
-
"description": "自定义整个菜单的内容"
|
|
368
|
-
}
|
|
369
|
-
],
|
|
370
|
-
"methods": [],
|
|
371
|
-
"subComponents": [
|
|
372
|
-
{
|
|
373
|
-
"name": "Option",
|
|
374
|
-
"description": "选项组件,用于定义下拉选项",
|
|
375
|
-
"props": [
|
|
376
|
-
{
|
|
377
|
-
"name": "value",
|
|
378
|
-
"description": "选中的值",
|
|
379
|
-
"type": {
|
|
380
|
-
"raw": "any",
|
|
381
|
-
"kind": "custom"
|
|
382
|
-
},
|
|
383
|
-
"required": false,
|
|
384
|
-
"default": "undefined",
|
|
385
|
-
"usageExample": "<Option value=\"apple\" label=\"苹果\" />"
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"name": "label",
|
|
389
|
-
"description": "展示文案,同时也作为筛选的内容。不存在时使用 children 的文本",
|
|
390
|
-
"type": {
|
|
391
|
-
"raw": "string",
|
|
392
|
-
"kind": "string"
|
|
393
|
-
},
|
|
394
|
-
"required": false,
|
|
395
|
-
"default": "undefined",
|
|
396
|
-
"usageExample": "<Option value=\"apple\" label=\"苹果\" />"
|
|
397
|
-
},
|
|
398
|
-
{
|
|
399
|
-
"name": "disabled",
|
|
400
|
-
"description": "是否禁用该项选择",
|
|
401
|
-
"type": {
|
|
402
|
-
"raw": "boolean",
|
|
403
|
-
"kind": "boolean"
|
|
404
|
-
},
|
|
405
|
-
"required": false,
|
|
406
|
-
"default": "false",
|
|
407
|
-
"usageExample": "<Option value=\"apple\" label=\"苹果\" disabled />"
|
|
338
|
+
],
|
|
339
|
+
"events": [
|
|
340
|
+
{
|
|
341
|
+
"name": "show",
|
|
342
|
+
"vueEventName": "@show",
|
|
343
|
+
"description": "菜单弹出时触发",
|
|
344
|
+
"payload": [],
|
|
345
|
+
"usageExample": "<Select @show=\"handleShow\">",
|
|
346
|
+
"handlerExample": "const handleShow = () => {\n console.log('下拉菜单已展开');\n};"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"name": "hide",
|
|
350
|
+
"vueEventName": "@hide",
|
|
351
|
+
"description": "菜单隐藏时触发",
|
|
352
|
+
"payload": [],
|
|
353
|
+
"usageExample": "<Select @hide=\"handleHide\">",
|
|
354
|
+
"handlerExample": "const handleHide = () => {\n console.log('下拉菜单已关闭');\n};"
|
|
408
355
|
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
"
|
|
420
|
-
"
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
356
|
+
],
|
|
357
|
+
"methods": [
|
|
358
|
+
{
|
|
359
|
+
"name": "show",
|
|
360
|
+
"description": "主动展开选择器下拉面板。",
|
|
361
|
+
"params": [],
|
|
362
|
+
"returnType": "void",
|
|
363
|
+
"usageExample": "selectRef.value?.show();"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "hide",
|
|
367
|
+
"description": "主动关闭选择器下拉面板。",
|
|
368
|
+
"params": [],
|
|
369
|
+
"returnType": "void",
|
|
370
|
+
"usageExample": "selectRef.value?.hide();"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"name": "position",
|
|
374
|
+
"description": "重新计算当前选择器下拉面板的位置。",
|
|
375
|
+
"params": [],
|
|
376
|
+
"returnType": "void",
|
|
377
|
+
"usageExample": "selectRef.value?.position();"
|
|
425
378
|
}
|
|
426
|
-
|
|
427
|
-
|
|
379
|
+
],
|
|
380
|
+
"subComponents": [
|
|
381
|
+
{
|
|
382
|
+
"name": "Option",
|
|
383
|
+
"description": "选项组件,用于定义下拉选项",
|
|
384
|
+
"props": [
|
|
385
|
+
{
|
|
386
|
+
"name": "value",
|
|
387
|
+
"description": "选中的值",
|
|
388
|
+
"type": {
|
|
389
|
+
"raw": "any",
|
|
390
|
+
"kind": "custom"
|
|
391
|
+
},
|
|
392
|
+
"required": false,
|
|
393
|
+
"default": "undefined",
|
|
394
|
+
"usageExample": "<Option value=\"apple\" label=\"苹果\" />"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"name": "label",
|
|
398
|
+
"description": "展示文案,同时也作为筛选的内容。不存在时使用 children 的文本",
|
|
399
|
+
"type": {
|
|
400
|
+
"raw": "string",
|
|
401
|
+
"kind": "string"
|
|
402
|
+
},
|
|
403
|
+
"required": false,
|
|
404
|
+
"default": "undefined",
|
|
405
|
+
"usageExample": "<Option value=\"apple\" label=\"苹果\" />"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
"name": "disabled",
|
|
409
|
+
"description": "是否禁用该项选择",
|
|
410
|
+
"type": {
|
|
411
|
+
"raw": "boolean",
|
|
412
|
+
"kind": "boolean"
|
|
413
|
+
},
|
|
414
|
+
"required": false,
|
|
415
|
+
"default": "false",
|
|
416
|
+
"usageExample": "<Option value=\"apple\" label=\"苹果\" disabled />"
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
},
|
|
428
420
|
{
|
|
429
|
-
|
|
430
|
-
|
|
421
|
+
"name": "OptionGroup",
|
|
422
|
+
"description": "选项分组组件,用于对选项进行分组展示",
|
|
423
|
+
"props": [
|
|
424
|
+
{
|
|
425
|
+
"name": "label",
|
|
426
|
+
"description": "分组标签名",
|
|
427
|
+
"type": {
|
|
428
|
+
"raw": "string | number | VNode",
|
|
429
|
+
"kind": "union"
|
|
430
|
+
},
|
|
431
|
+
"required": false,
|
|
432
|
+
"default": "undefined",
|
|
433
|
+
"usageExample": "<OptionGroup label=\"水果\">\n <Option value=\"apple\" label=\"苹果\" />\n</OptionGroup>"
|
|
434
|
+
}
|
|
435
|
+
]
|
|
431
436
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
437
|
+
],
|
|
438
|
+
"typeDefinitions": [
|
|
439
|
+
{
|
|
440
|
+
"name": "Position",
|
|
441
|
+
"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}",
|
|
442
|
+
"description": "菜单弹出位置配置"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "Collision",
|
|
446
|
+
"definition": "type Collision = 'fit' | 'flip' | 'flipfit' | 'none'",
|
|
447
|
+
"description": "碰撞检测行为"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"name": "Container",
|
|
451
|
+
"definition": "type Container = string | ((parentDom: Element, anchor: Node | null) => Element)",
|
|
452
|
+
"description": "容器类型,可以是选择器字符串或返回元素的函数"
|
|
453
|
+
}
|
|
454
|
+
],
|
|
455
|
+
"examples": [
|
|
456
|
+
{
|
|
457
|
+
"id": "select_basic",
|
|
458
|
+
"title": "基础用法",
|
|
459
|
+
"description": "基本的下拉选择框",
|
|
460
|
+
"difficulty": "easy",
|
|
461
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" placeholder=\"请选择\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n <Option value=\"banana\" label=\"香蕉\" />\n </Select>\n</template>",
|
|
462
|
+
"tags": [
|
|
463
|
+
"basic",
|
|
464
|
+
"single"
|
|
465
|
+
],
|
|
466
|
+
"usedProps": [
|
|
467
|
+
"value",
|
|
468
|
+
"placeholder"
|
|
469
|
+
],
|
|
470
|
+
"usedEvents": [],
|
|
471
|
+
"usedMethods": [],
|
|
472
|
+
"scenario": "创建一个基本的单选下拉框"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
"id": "select_multiple",
|
|
476
|
+
"title": "多选",
|
|
477
|
+
"description": "支持选择多个选项",
|
|
478
|
+
"difficulty": "easy",
|
|
479
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref<string[]>([]);\n</script>\n<template>\n <Select v-model=\"selected\" multiple placeholder=\"请选择多项\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n <Option value=\"banana\" label=\"香蕉\" />\n <Option value=\"grape\" label=\"葡萄\" />\n </Select>\n</template>",
|
|
480
|
+
"tags": [
|
|
481
|
+
"multiple",
|
|
482
|
+
"multi-select"
|
|
483
|
+
],
|
|
484
|
+
"usedProps": [
|
|
485
|
+
"value",
|
|
486
|
+
"multiple",
|
|
487
|
+
"placeholder"
|
|
488
|
+
],
|
|
489
|
+
"usedEvents": [],
|
|
490
|
+
"usedMethods": [],
|
|
491
|
+
"scenario": "创建一个支持多选的下拉框"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"id": "select_filterable",
|
|
495
|
+
"title": "可搜索",
|
|
496
|
+
"description": "可以通过输入关键字筛选选项",
|
|
497
|
+
"difficulty": "easy",
|
|
498
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" filterable placeholder=\"输入关键字搜索\">\n <Option value=\"beijing\" label=\"北京\" />\n <Option value=\"shanghai\" label=\"上海\" />\n <Option value=\"guangzhou\" label=\"广州\" />\n <Option value=\"shenzhen\" label=\"深圳\" />\n </Select>\n</template>",
|
|
499
|
+
"tags": [
|
|
500
|
+
"filterable",
|
|
501
|
+
"search",
|
|
502
|
+
"filter"
|
|
503
|
+
],
|
|
504
|
+
"usedProps": [
|
|
505
|
+
"value",
|
|
506
|
+
"filterable",
|
|
507
|
+
"placeholder"
|
|
508
|
+
],
|
|
509
|
+
"usedEvents": [],
|
|
510
|
+
"usedMethods": [],
|
|
511
|
+
"scenario": "创建一个可以通过关键字搜索的下拉框"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"id": "select_clearable",
|
|
515
|
+
"title": "可清空",
|
|
516
|
+
"description": "支持一键清空已选内容",
|
|
517
|
+
"difficulty": "easy",
|
|
518
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('apple');\n</script>\n<template>\n <Select v-model=\"selected\" clearable>\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </Select>\n</template>",
|
|
519
|
+
"tags": [
|
|
520
|
+
"clearable",
|
|
521
|
+
"clear"
|
|
522
|
+
],
|
|
523
|
+
"usedProps": [
|
|
524
|
+
"value",
|
|
525
|
+
"clearable"
|
|
526
|
+
],
|
|
527
|
+
"usedEvents": [],
|
|
528
|
+
"usedMethods": [],
|
|
529
|
+
"scenario": "创建一个可以清空已选值的下拉框"
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
"id": "select_group",
|
|
533
|
+
"title": "分组选项",
|
|
534
|
+
"description": "使用 OptionGroup 对选项进行分组",
|
|
535
|
+
"difficulty": "medium",
|
|
536
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option, OptionGroup } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" placeholder=\"请选择\">\n <OptionGroup label=\"水果\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </OptionGroup>\n <OptionGroup label=\"蔬菜\">\n <Option value=\"tomato\" label=\"番茄\" />\n <Option value=\"potato\" label=\"土豆\" />\n </OptionGroup>\n </Select>\n</template>",
|
|
537
|
+
"tags": [
|
|
538
|
+
"group",
|
|
539
|
+
"OptionGroup",
|
|
540
|
+
"category"
|
|
541
|
+
],
|
|
542
|
+
"usedProps": [
|
|
543
|
+
"value",
|
|
544
|
+
"placeholder"
|
|
545
|
+
],
|
|
546
|
+
"usedEvents": [],
|
|
547
|
+
"usedMethods": [],
|
|
548
|
+
"scenario": "创建带有分组的下拉选择框"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
"id": "select_disabled_option",
|
|
552
|
+
"title": "禁用选项",
|
|
553
|
+
"description": "禁用特定的选项",
|
|
554
|
+
"difficulty": "easy",
|
|
555
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" disabled />\n <Option value=\"banana\" label=\"香蕉\" />\n </Select>\n</template>",
|
|
556
|
+
"tags": [
|
|
557
|
+
"disabled",
|
|
558
|
+
"option"
|
|
559
|
+
],
|
|
560
|
+
"usedProps": [
|
|
561
|
+
"value"
|
|
562
|
+
],
|
|
563
|
+
"usedEvents": [],
|
|
564
|
+
"usedMethods": [],
|
|
565
|
+
"scenario": "禁用下拉框中的某些选项"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
"id": "select_creatable",
|
|
569
|
+
"title": "可创建选项",
|
|
570
|
+
"description": "允许用户创建新的选项",
|
|
571
|
+
"difficulty": "medium",
|
|
572
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" filterable creatable placeholder=\"可输入创建新选项\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </Select>\n</template>",
|
|
573
|
+
"tags": [
|
|
574
|
+
"creatable",
|
|
575
|
+
"create",
|
|
576
|
+
"filterable"
|
|
577
|
+
],
|
|
578
|
+
"usedProps": [
|
|
579
|
+
"value",
|
|
580
|
+
"filterable",
|
|
581
|
+
"creatable",
|
|
582
|
+
"placeholder"
|
|
583
|
+
],
|
|
584
|
+
"usedEvents": [],
|
|
585
|
+
"usedMethods": [],
|
|
586
|
+
"scenario": "创建一个允许用户输入新选项的下拉框"
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
"id": "select_loading",
|
|
590
|
+
"title": "加载状态",
|
|
591
|
+
"description": "展示数据加载中的状态",
|
|
592
|
+
"difficulty": "easy",
|
|
593
|
+
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\nconst loading = ref(true);\n\n// 模拟异步加载\nsetTimeout(() => {\n loading.value = false;\n}, 2000);\n</script>\n<template>\n <Select v-model=\"selected\" :loading=\"loading\" placeholder=\"加载中...\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </Select>\n</template>",
|
|
594
|
+
"tags": [
|
|
595
|
+
"loading",
|
|
596
|
+
"async"
|
|
597
|
+
],
|
|
598
|
+
"usedProps": [
|
|
599
|
+
"value",
|
|
600
|
+
"loading",
|
|
601
|
+
"placeholder"
|
|
602
|
+
],
|
|
603
|
+
"usedEvents": [],
|
|
604
|
+
"usedMethods": [],
|
|
605
|
+
"scenario": "展示异步加载数据时的加载状态"
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
"commonMistakes": [
|
|
609
|
+
{
|
|
610
|
+
"id": "select_multiple_type",
|
|
611
|
+
"description": "多选模式下 value 类型错误",
|
|
612
|
+
"wrongCode": "const selected = ref('');\n<Select v-model=\"selected\" multiple>",
|
|
613
|
+
"correctCode": "const selected = ref<string[]>([]);\n<Select v-model=\"selected\" multiple>",
|
|
614
|
+
"explanation": "使用 multiple 多选模式时,value 必须是数组类型,而非字符串",
|
|
615
|
+
"relatedProps": [
|
|
616
|
+
"multiple",
|
|
617
|
+
"value"
|
|
618
|
+
]
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
"id": "select_option_value",
|
|
622
|
+
"description": "Option 未设置 value 属性",
|
|
623
|
+
"wrongCode": "<Select v-model=\"selected\">\n <Option label=\"苹果\" />\n</Select>",
|
|
624
|
+
"correctCode": "<Select v-model=\"selected\">\n <Option value=\"apple\" label=\"苹果\" />\n</Select>",
|
|
625
|
+
"explanation": "Option 必须设置 value 属性,否则无法正确绑定选中值",
|
|
626
|
+
"relatedProps": [
|
|
627
|
+
"value"
|
|
628
|
+
]
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
"id": "select_size_typo",
|
|
632
|
+
"description": "使用不存在的 size 值 (Select)",
|
|
633
|
+
"wrongCode": "<Select size=\"medium\">",
|
|
634
|
+
"correctCode": "<Select size=\"default\">",
|
|
635
|
+
"explanation": "Select 的 size 只支持 large, default, small, mini。常见错误是使用 medium 值。",
|
|
636
|
+
"relatedProps": [
|
|
637
|
+
"size"
|
|
638
|
+
]
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
"id": "select_creatable_without_filterable",
|
|
642
|
+
"description": "使用 creatable 但未启用 filterable",
|
|
643
|
+
"wrongCode": "<Select creatable>",
|
|
644
|
+
"correctCode": "<Select filterable creatable>",
|
|
645
|
+
"explanation": "creatable 属性需要配合 filterable 使用,因为创建新选项需要用户输入",
|
|
646
|
+
"relatedProps": [
|
|
647
|
+
"filterable",
|
|
648
|
+
"creatable"
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
],
|
|
652
|
+
"searchKeywords": [
|
|
653
|
+
"选择框",
|
|
654
|
+
"select",
|
|
655
|
+
"下拉",
|
|
656
|
+
"dropdown",
|
|
657
|
+
"option",
|
|
658
|
+
"多选",
|
|
483
659
|
"multiple",
|
|
484
|
-
"
|
|
485
|
-
],
|
|
486
|
-
"usedEvents": [],
|
|
487
|
-
"usedMethods": [],
|
|
488
|
-
"scenario": "创建一个支持多选的下拉框"
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
"id": "select_filterable",
|
|
492
|
-
"title": "可搜索",
|
|
493
|
-
"description": "可以通过输入关键字筛选选项",
|
|
494
|
-
"difficulty": "easy",
|
|
495
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" filterable placeholder=\"输入关键字搜索\">\n <Option value=\"beijing\" label=\"北京\" />\n <Option value=\"shanghai\" label=\"上海\" />\n <Option value=\"guangzhou\" label=\"广州\" />\n <Option value=\"shenzhen\" label=\"深圳\" />\n </Select>\n</template>",
|
|
496
|
-
"tags": [
|
|
497
|
-
"filterable",
|
|
498
|
-
"search",
|
|
499
|
-
"filter"
|
|
500
|
-
],
|
|
501
|
-
"usedProps": [
|
|
502
|
-
"value",
|
|
660
|
+
"筛选",
|
|
503
661
|
"filterable",
|
|
504
|
-
"
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
"tags": [
|
|
535
|
-
"group",
|
|
662
|
+
"分组",
|
|
663
|
+
"OptionGroup"
|
|
664
|
+
],
|
|
665
|
+
"useCases": [
|
|
666
|
+
"表单中的下拉选择",
|
|
667
|
+
"城市/地区选择器",
|
|
668
|
+
"多标签选择",
|
|
669
|
+
"分类筛选器",
|
|
670
|
+
"动态加载选项",
|
|
671
|
+
"可创建新选项的标签选择"
|
|
672
|
+
],
|
|
673
|
+
"typeDefinitions": [
|
|
674
|
+
{
|
|
675
|
+
"name": "SelectSize",
|
|
676
|
+
"definition": "type SelectSize = 'large' | 'default' | 'small' | 'mini'",
|
|
677
|
+
"description": "下拉选择器尺寸枚举,用于控制输入框和弹层的视觉大小。"
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
"name": "SelectOptionItem",
|
|
681
|
+
"definition": "type SelectOptionItem = {\\n value: string | number\\n label: string\\n disabled?: boolean\\n}",
|
|
682
|
+
"description": "下拉选项的基础数据结构,描述值、文案和可选禁用状态。"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
"name": "SelectFilter",
|
|
686
|
+
"definition": "type SelectFilter = (keywords: string, props: any) => boolean",
|
|
687
|
+
"description": "自定义筛选函数签名,用于 filterable 模式下控制选项过滤逻辑。"
|
|
688
|
+
}
|
|
689
|
+
],
|
|
690
|
+
"relatedComponents": [
|
|
691
|
+
"Option",
|
|
536
692
|
"OptionGroup",
|
|
537
|
-
"
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
"value",
|
|
541
|
-
"placeholder"
|
|
542
|
-
],
|
|
543
|
-
"usedEvents": [],
|
|
544
|
-
"usedMethods": [],
|
|
545
|
-
"scenario": "创建带有分组的下拉选择框"
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
"id": "select_disabled_option",
|
|
549
|
-
"title": "禁用选项",
|
|
550
|
-
"description": "禁用特定的选项",
|
|
551
|
-
"difficulty": "easy",
|
|
552
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" disabled />\n <Option value=\"banana\" label=\"香蕉\" />\n </Select>\n</template>",
|
|
553
|
-
"tags": [
|
|
554
|
-
"disabled",
|
|
555
|
-
"option"
|
|
556
|
-
],
|
|
557
|
-
"usedProps": [
|
|
558
|
-
"value"
|
|
559
|
-
],
|
|
560
|
-
"usedEvents": [],
|
|
561
|
-
"usedMethods": [],
|
|
562
|
-
"scenario": "禁用下拉框中的某些选项"
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
"id": "select_creatable",
|
|
566
|
-
"title": "可创建选项",
|
|
567
|
-
"description": "允许用户创建新的选项",
|
|
568
|
-
"difficulty": "medium",
|
|
569
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\n</script>\n<template>\n <Select v-model=\"selected\" filterable creatable placeholder=\"可输入创建新选项\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </Select>\n</template>",
|
|
570
|
-
"tags": [
|
|
571
|
-
"creatable",
|
|
572
|
-
"create",
|
|
573
|
-
"filterable"
|
|
574
|
-
],
|
|
575
|
-
"usedProps": [
|
|
576
|
-
"value",
|
|
577
|
-
"filterable",
|
|
578
|
-
"creatable",
|
|
579
|
-
"placeholder"
|
|
580
|
-
],
|
|
581
|
-
"usedEvents": [],
|
|
582
|
-
"usedMethods": [],
|
|
583
|
-
"scenario": "创建一个允许用户输入新选项的下拉框"
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
"id": "select_loading",
|
|
587
|
-
"title": "加载状态",
|
|
588
|
-
"description": "展示数据加载中的状态",
|
|
589
|
-
"difficulty": "easy",
|
|
590
|
-
"code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Select, Option } from '@king-design/vue';\n\nconst selected = ref('');\nconst loading = ref(true);\n\n// 模拟异步加载\nsetTimeout(() => {\n loading.value = false;\n}, 2000);\n</script>\n<template>\n <Select v-model=\"selected\" :loading=\"loading\" placeholder=\"加载中...\">\n <Option value=\"apple\" label=\"苹果\" />\n <Option value=\"orange\" label=\"橙子\" />\n </Select>\n</template>",
|
|
591
|
-
"tags": [
|
|
592
|
-
"loading",
|
|
593
|
-
"async"
|
|
594
|
-
],
|
|
595
|
-
"usedProps": [
|
|
596
|
-
"value",
|
|
597
|
-
"loading",
|
|
598
|
-
"placeholder"
|
|
599
|
-
],
|
|
600
|
-
"usedEvents": [],
|
|
601
|
-
"usedMethods": [],
|
|
602
|
-
"scenario": "展示异步加载数据时的加载状态"
|
|
603
|
-
}
|
|
604
|
-
],
|
|
605
|
-
"commonMistakes": [
|
|
606
|
-
{
|
|
607
|
-
"id": "select_multiple_type",
|
|
608
|
-
"description": "多选模式下 value 类型错误",
|
|
609
|
-
"wrongCode": "const selected = ref('');\n<Select v-model=\"selected\" multiple>",
|
|
610
|
-
"correctCode": "const selected = ref<string[]>([]);\n<Select v-model=\"selected\" multiple>",
|
|
611
|
-
"explanation": "使用 multiple 多选模式时,value 必须是数组类型,而非字符串",
|
|
612
|
-
"relatedProps": [
|
|
613
|
-
"multiple",
|
|
614
|
-
"value"
|
|
615
|
-
]
|
|
616
|
-
},
|
|
617
|
-
{
|
|
618
|
-
"id": "select_option_value",
|
|
619
|
-
"description": "Option 未设置 value 属性",
|
|
620
|
-
"wrongCode": "<Select v-model=\"selected\">\n <Option label=\"苹果\" />\n</Select>",
|
|
621
|
-
"correctCode": "<Select v-model=\"selected\">\n <Option value=\"apple\" label=\"苹果\" />\n</Select>",
|
|
622
|
-
"explanation": "Option 必须设置 value 属性,否则无法正确绑定选中值",
|
|
623
|
-
"relatedProps": [
|
|
624
|
-
"value"
|
|
625
|
-
]
|
|
626
|
-
},
|
|
627
|
-
{
|
|
628
|
-
"id": "select_size_typo",
|
|
629
|
-
"description": "使用不存在的 size 值 (Select)",
|
|
630
|
-
"wrongCode": "<Select size=\"medium\">",
|
|
631
|
-
"correctCode": "<Select size=\"default\">",
|
|
632
|
-
"explanation": "Select 的 size 只支持 large, default, small, mini。常见错误是使用 medium 值。",
|
|
633
|
-
"relatedProps": [
|
|
634
|
-
"size"
|
|
635
|
-
]
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
"id": "select_creatable_without_filterable",
|
|
639
|
-
"description": "使用 creatable 但未启用 filterable",
|
|
640
|
-
"wrongCode": "<Select creatable>",
|
|
641
|
-
"correctCode": "<Select filterable creatable>",
|
|
642
|
-
"explanation": "creatable 属性需要配合 filterable 使用,因为创建新选项需要用户输入",
|
|
643
|
-
"relatedProps": [
|
|
644
|
-
"filterable",
|
|
645
|
-
"creatable"
|
|
646
|
-
]
|
|
647
|
-
}
|
|
648
|
-
],
|
|
649
|
-
"searchKeywords": [
|
|
650
|
-
"选择框",
|
|
651
|
-
"select",
|
|
652
|
-
"下拉",
|
|
653
|
-
"dropdown",
|
|
654
|
-
"option",
|
|
655
|
-
"多选",
|
|
656
|
-
"multiple",
|
|
657
|
-
"筛选",
|
|
658
|
-
"filterable",
|
|
659
|
-
"分组",
|
|
660
|
-
"OptionGroup"
|
|
661
|
-
],
|
|
662
|
-
"useCases": [
|
|
663
|
-
"表单中的下拉选择",
|
|
664
|
-
"城市/地区选择器",
|
|
665
|
-
"多标签选择",
|
|
666
|
-
"分类筛选器",
|
|
667
|
-
"动态加载选项",
|
|
668
|
-
"可创建新选项的标签选择"
|
|
669
|
-
],
|
|
670
|
-
"relatedComponents": [
|
|
671
|
-
"Option",
|
|
672
|
-
"OptionGroup",
|
|
673
|
-
"Cascader",
|
|
674
|
-
"TreeSelect"
|
|
675
|
-
]
|
|
693
|
+
"Cascader",
|
|
694
|
+
"TreeSelect"
|
|
695
|
+
]
|
|
676
696
|
}
|