king-design-analyzer 2.1.9 → 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.
Files changed (305) hide show
  1. package/components/actions.json +101 -0
  2. package/components/advancedset.json +127 -0
  3. package/components/affix.json +7 -0
  4. package/components/aksk.json +172 -0
  5. package/components/az.json +15 -2
  6. package/components/badge.json +7 -0
  7. package/components/billtypes.json +14 -2
  8. package/components/breadcrumb.json +7 -0
  9. package/components/button.json +191 -0
  10. package/components/buttonlink.json +73 -0
  11. package/components/card.json +8 -1
  12. package/components/cardcol.json +142 -0
  13. package/components/cardcols.json +121 -0
  14. package/components/cardcontent.json +15 -3
  15. package/components/cardtabs.json +172 -0
  16. package/components/carousel.json +7 -0
  17. package/components/cascader.json +520 -368
  18. package/components/checkbox.json +51 -4
  19. package/components/cidrinput.json +140 -0
  20. package/components/code.json +8 -1
  21. package/components/collapse.json +7 -0
  22. package/components/colorpicker.json +217 -0
  23. package/components/copy.json +7 -0
  24. package/components/copyhover.json +111 -0
  25. package/components/copyrow.json +124 -0
  26. package/components/datepicker.json +656 -524
  27. package/components/description.json +98 -0
  28. package/components/dialog.json +522 -455
  29. package/components/divider.json +8 -1
  30. package/components/drawer.json +571 -558
  31. package/components/dropdown.json +464 -384
  32. package/components/duration.json +125 -0
  33. package/components/editable.json +66 -0
  34. package/components/ellipsis.json +34 -1
  35. package/components/filtertablefieldsdialog.json +128 -0
  36. package/components/flex.json +151 -0
  37. package/components/form.json +131 -0
  38. package/components/formiteminput.json +214 -0
  39. package/components/formitemspinner.json +213 -0
  40. package/components/formitemswitch.json +185 -0
  41. package/components/formitemtableconfigs.json +210 -0
  42. package/components/grid.json +7 -0
  43. package/components/header.json +161 -0
  44. package/components/icon.json +13 -1
  45. package/components/icontooltip.json +19 -1
  46. package/components/input.json +188 -4
  47. package/components/instancelist.json +194 -0
  48. package/components/instancenum.json +196 -0
  49. package/components/ipinput.json +117 -0
  50. package/components/kspstatus.json +205 -0
  51. package/components/kvcode.json +120 -0
  52. package/components/layoutcontent.json +15 -3
  53. package/components/layoutlistcontent.json +148 -0
  54. package/components/layoutpermissioncontent.json +155 -0
  55. package/components/layoutstandardlist.json +275 -0
  56. package/components/layouttabs.json +168 -0
  57. package/components/lazymount.json +86 -0
  58. package/components/lazyteleport.json +118 -0
  59. package/components/menu.json +7 -0
  60. package/components/pagination.json +12 -0
  61. package/components/paginationplus.json +30 -3
  62. package/components/password.json +121 -0
  63. package/components/popover.json +457 -437
  64. package/components/projects.json +129 -0
  65. package/components/protable.json +97 -8
  66. package/components/queuevisualrange.json +110 -0
  67. package/components/radio.json +82 -2
  68. package/components/rate.json +199 -0
  69. package/components/region.json +14 -2
  70. package/components/search.json +221 -0
  71. package/components/searchinput.json +132 -0
  72. package/components/searchitems.json +215 -0
  73. package/components/searchselect.json +195 -0
  74. package/components/select.json +686 -666
  75. package/components/sidebar.json +198 -0
  76. package/components/skeleton.json +233 -0
  77. package/components/spin.json +8 -1
  78. package/components/split.json +260 -0
  79. package/components/sshkeys.json +138 -0
  80. package/components/status.json +60 -3
  81. package/components/steps.json +7 -0
  82. package/components/switch.json +8 -1
  83. package/components/table.json +18 -1
  84. package/components/tablecolumnid.json +14 -2
  85. package/components/tabs.json +12 -0
  86. package/components/timeline.json +213 -0
  87. package/components/timepicker.json +147 -3
  88. package/components/timerange.json +262 -0
  89. package/components/tip.json +7 -0
  90. package/components/tooltip.json +484 -395
  91. package/components/tour.json +418 -372
  92. package/components/transfer.json +27 -3
  93. package/components/tree.json +6 -4
  94. package/components/treeselect.json +556 -475
  95. package/components/upload.json +474 -473
  96. package/components/vdialog.json +308 -0
  97. package/components/vdrawer.json +331 -0
  98. package/components/virtuallist.json +7 -0
  99. package/dist/ast/index.d.mts +35 -1
  100. package/dist/ast/index.d.ts +35 -1
  101. package/dist/ast/index.js +4 -3
  102. package/dist/ast/index.mjs +2 -1
  103. package/dist/{chunk-DSWKLUIX.mjs → chunk-3LYQ5XFM.mjs} +1 -1
  104. package/dist/chunk-BI5TIQID.mjs +330 -0
  105. package/dist/{chunk-F26GUCGG.js → chunk-CJGGFVQJ.js} +8 -8
  106. package/dist/chunk-CR3GC4H3.js +353 -0
  107. package/dist/{chunk-NZ6TLWMD.mjs → chunk-D2SXGGTX.mjs} +28 -17
  108. package/dist/{chunk-D3Y6FGWA.js → chunk-EYKZY2F3.js} +29 -18
  109. package/dist/chunk-KF5YBEM5.js +143 -0
  110. package/dist/{chunk-H2ET6MMM.mjs → chunk-KMIDURUR.mjs} +42 -47
  111. package/dist/chunk-QC6VTSA3.mjs +117 -0
  112. package/dist/{chunk-2W6OCG2S.js → chunk-SZYVGYKK.js} +42 -48
  113. package/dist/{chunk-WYSRJVX4.js → chunk-TA3SV4SP.js} +2 -2
  114. package/dist/{chunk-OJOHB64C.mjs → chunk-XGPHQHLR.mjs} +4 -4
  115. package/dist/full/index.js +7 -6
  116. package/dist/full/index.mjs +5 -4
  117. package/dist/index.d.mts +1 -0
  118. package/dist/index.d.ts +1 -0
  119. package/dist/index.js +14 -13
  120. package/dist/index.mjs +6 -5
  121. package/dist/metadata/index.d.mts +22 -2
  122. package/dist/metadata/index.d.ts +22 -2
  123. package/dist/metadata/index.js +26 -16
  124. package/dist/metadata/index.mjs +26 -15
  125. package/dist/resolve-BsLBxlBi.d.mts +24 -0
  126. package/dist/resolve-BsLBxlBi.d.ts +24 -0
  127. package/dist/runtime/index.js +4 -4
  128. package/dist/runtime/index.mjs +2 -2
  129. package/dist/shared/index.d.mts +10 -0
  130. package/dist/shared/index.d.ts +10 -0
  131. package/dist/shared/index.js +23 -0
  132. package/dist/shared/index.mjs +2 -0
  133. package/dist/static/index.js +5 -5
  134. package/dist/static/index.mjs +2 -2
  135. package/docs_for_llm/actions.doc.md +77 -0
  136. package/docs_for_llm/advancedset.doc.md +89 -0
  137. package/docs_for_llm/affix.doc.md +15 -7
  138. package/docs_for_llm/aksk.doc.md +111 -0
  139. package/docs_for_llm/az.doc.md +17 -11
  140. package/docs_for_llm/badge.doc.md +6 -5
  141. package/docs_for_llm/billtypes.doc.md +17 -11
  142. package/docs_for_llm/breadcrumb.doc.md +6 -3
  143. package/docs_for_llm/button.doc.md +34 -18
  144. package/docs_for_llm/buttonlink.doc.md +55 -0
  145. package/docs_for_llm/card.doc.md +8 -5
  146. package/docs_for_llm/cardcol.doc.md +78 -0
  147. package/docs_for_llm/cardcols.doc.md +84 -0
  148. package/docs_for_llm/cardcontent.doc.md +10 -10
  149. package/docs_for_llm/cardtabs.doc.md +106 -0
  150. package/docs_for_llm/carousel.doc.md +8 -7
  151. package/docs_for_llm/cascader.doc.md +46 -25
  152. package/docs_for_llm/checkbox.doc.md +25 -13
  153. package/docs_for_llm/cidrinput.doc.md +83 -0
  154. package/docs_for_llm/code.doc.md +22 -11
  155. package/docs_for_llm/collapse.doc.md +9 -6
  156. package/docs_for_llm/colorpicker.doc.md +104 -0
  157. package/docs_for_llm/copy.doc.md +15 -13
  158. package/docs_for_llm/copyhover.doc.md +59 -0
  159. package/docs_for_llm/copyrow.doc.md +71 -0
  160. package/docs_for_llm/datepicker.doc.md +51 -39
  161. package/docs_for_llm/description.doc.md +75 -0
  162. package/docs_for_llm/descriptions.doc.md +9 -6
  163. package/docs_for_llm/dialog.doc.md +48 -77
  164. package/docs_for_llm/divider.doc.md +9 -7
  165. package/docs_for_llm/drawer.doc.md +43 -84
  166. package/docs_for_llm/dropdown.doc.md +52 -21
  167. package/docs_for_llm/duration.doc.md +76 -0
  168. package/docs_for_llm/editable.doc.md +36 -14
  169. package/docs_for_llm/ellipsis.doc.md +10 -5
  170. package/docs_for_llm/filtertablefieldsdialog.doc.md +99 -0
  171. package/docs_for_llm/flex.doc.md +74 -0
  172. package/docs_for_llm/form.doc.md +33 -14
  173. package/docs_for_llm/formiteminput.doc.md +128 -0
  174. package/docs_for_llm/formitemspinner.doc.md +105 -0
  175. package/docs_for_llm/formitemswitch.doc.md +113 -0
  176. package/docs_for_llm/formitemtableconfigs.doc.md +95 -0
  177. package/docs_for_llm/grid.doc.md +7 -5
  178. package/docs_for_llm/header.doc.md +85 -0
  179. package/docs_for_llm/icon.doc.md +12 -8
  180. package/docs_for_llm/icontooltip.doc.md +121 -0
  181. package/docs_for_llm/input.doc.md +90 -39
  182. package/docs_for_llm/instancelist.doc.md +113 -0
  183. package/docs_for_llm/instancenum.doc.md +95 -0
  184. package/docs_for_llm/ipinput.doc.md +77 -0
  185. package/docs_for_llm/kspstatus.doc.md +82 -0
  186. package/docs_for_llm/kvcode.doc.md +76 -0
  187. package/docs_for_llm/layoutcontent.doc.md +17 -17
  188. package/docs_for_llm/layoutlistcontent.doc.md +95 -0
  189. package/docs_for_llm/layoutpermissioncontent.doc.md +84 -0
  190. package/docs_for_llm/layoutstandardlist.doc.md +120 -0
  191. package/docs_for_llm/layouttabs.doc.md +101 -0
  192. package/docs_for_llm/lazymount.doc.md +73 -0
  193. package/docs_for_llm/lazyteleport.doc.md +76 -0
  194. package/docs_for_llm/menu.doc.md +14 -11
  195. package/docs_for_llm/message.doc.md +48 -10
  196. package/docs_for_llm/pagination.doc.md +30 -17
  197. package/docs_for_llm/paginationplus.doc.md +31 -10
  198. package/docs_for_llm/password.doc.md +86 -0
  199. package/docs_for_llm/popover.doc.md +24 -55
  200. package/docs_for_llm/progress.doc.md +13 -10
  201. package/docs_for_llm/projects.doc.md +91 -0
  202. package/docs_for_llm/protable.doc.md +89 -15
  203. package/docs_for_llm/queuevisualrange.doc.md +78 -0
  204. package/docs_for_llm/radio.doc.md +23 -8
  205. package/docs_for_llm/rate.doc.md +122 -0
  206. package/docs_for_llm/region.doc.md +25 -13
  207. package/docs_for_llm/search.doc.md +120 -0
  208. package/docs_for_llm/searchinput.doc.md +111 -0
  209. package/docs_for_llm/searchitems.doc.md +116 -0
  210. package/docs_for_llm/searchselect.doc.md +126 -0
  211. package/docs_for_llm/select.doc.md +40 -55
  212. package/docs_for_llm/sidebar.doc.md +133 -0
  213. package/docs_for_llm/skeleton.doc.md +117 -0
  214. package/docs_for_llm/slider.doc.md +31 -21
  215. package/docs_for_llm/spin.doc.md +8 -5
  216. package/docs_for_llm/spinner.doc.md +28 -18
  217. package/docs_for_llm/split.doc.md +157 -0
  218. package/docs_for_llm/sshkeys.doc.md +88 -0
  219. package/docs_for_llm/status.doc.md +14 -9
  220. package/docs_for_llm/steps.doc.md +10 -7
  221. package/docs_for_llm/switch.doc.md +17 -14
  222. package/docs_for_llm/table.doc.md +118 -51
  223. package/docs_for_llm/tablecolumnid.doc.md +36 -16
  224. package/docs_for_llm/tabs.doc.md +19 -10
  225. package/docs_for_llm/tag.doc.md +19 -10
  226. package/docs_for_llm/timeline.doc.md +109 -0
  227. package/docs_for_llm/timepicker.doc.md +57 -38
  228. package/docs_for_llm/timerange.doc.md +157 -0
  229. package/docs_for_llm/tip.doc.md +20 -11
  230. package/docs_for_llm/tooltip.doc.md +55 -29
  231. package/docs_for_llm/tour.doc.md +48 -29
  232. package/docs_for_llm/transfer.doc.md +40 -29
  233. package/docs_for_llm/tree.doc.md +65 -23
  234. package/docs_for_llm/treeselect.doc.md +37 -48
  235. package/docs_for_llm/upload.doc.md +56 -32
  236. package/docs_for_llm/useCRUD.doc.md +49 -0
  237. package/docs_for_llm/useCountdown.doc.md +43 -0
  238. package/docs_for_llm/useDetail.doc.md +48 -0
  239. package/docs_for_llm/useDialog.doc.md +46 -0
  240. package/docs_for_llm/useEntity.doc.md +45 -0
  241. package/docs_for_llm/useEventListener.doc.md +44 -0
  242. package/docs_for_llm/useFalseUntilTruthy.doc.md +41 -0
  243. package/docs_for_llm/useGetCopyAuthText.doc.md +35 -0
  244. package/docs_for_llm/useGetUserPermission.doc.md +43 -0
  245. package/docs_for_llm/useGroup.doc.md +48 -0
  246. package/docs_for_llm/useIdEntities.doc.md +48 -0
  247. package/docs_for_llm/useIdEntity.doc.md +103 -0
  248. package/docs_for_llm/useInterval.doc.md +43 -0
  249. package/docs_for_llm/useLayoutStandardList.doc.md +38 -0
  250. package/docs_for_llm/useMessage.doc.md +46 -0
  251. package/docs_for_llm/useModifyCache.doc.md +37 -0
  252. package/docs_for_llm/useOpenDialog.doc.md +41 -0
  253. package/docs_for_llm/usePagination.doc.md +60 -0
  254. package/docs_for_llm/usePersist.doc.md +54 -0
  255. package/docs_for_llm/usePoll.doc.md +41 -0
  256. package/docs_for_llm/useRoutePlus.doc.md +34 -0
  257. package/docs_for_llm/useRouterPlus.doc.md +34 -0
  258. package/docs_for_llm/useSearch.doc.md +68 -0
  259. package/docs_for_llm/useShell.doc.md +43 -0
  260. package/docs_for_llm/useSkip.doc.md +41 -0
  261. package/docs_for_llm/useStorageIdEntity.doc.md +46 -0
  262. package/docs_for_llm/useStore.doc.md +34 -0
  263. package/docs_for_llm/useTable.doc.md +57 -0
  264. package/docs_for_llm/useTableGroup.doc.md +47 -0
  265. package/docs_for_llm/useTableSort.doc.md +40 -0
  266. package/docs_for_llm/useToState.doc.md +112 -0
  267. package/docs_for_llm/useUser.doc.md +38 -0
  268. package/docs_for_llm/useValidForm.doc.md +41 -0
  269. package/docs_for_llm/vdialog.doc.md +129 -0
  270. package/docs_for_llm/vdrawer.doc.md +119 -0
  271. package/docs_for_llm/virtuallist.doc.md +6 -3
  272. package/hooks/useCRUD.json +61 -0
  273. package/hooks/useCountdown.json +49 -0
  274. package/hooks/useDetail.json +67 -0
  275. package/hooks/useDialog.json +49 -0
  276. package/hooks/useEntity.json +61 -0
  277. package/hooks/useEventListener.json +61 -0
  278. package/hooks/useFalseUntilTruthy.json +43 -0
  279. package/hooks/useGetCopyAuthText.json +36 -0
  280. package/hooks/useGetUserPermission.json +55 -0
  281. package/hooks/useGroup.json +49 -0
  282. package/hooks/useIdEntities.json +61 -0
  283. package/hooks/useInterval.json +55 -0
  284. package/hooks/useLayoutStandardList.json +36 -0
  285. package/hooks/useMessage.json +73 -0
  286. package/hooks/useModifyCache.json +36 -0
  287. package/hooks/useOpenDialog.json +43 -0
  288. package/hooks/usePagination.json +49 -0
  289. package/hooks/usePersist.json +61 -0
  290. package/hooks/usePoll.json +43 -0
  291. package/hooks/useRoutePlus.json +36 -0
  292. package/hooks/useRouterPlus.json +36 -0
  293. package/hooks/useSearch.json +56 -0
  294. package/hooks/useShell.json +49 -0
  295. package/hooks/useSkip.json +43 -0
  296. package/hooks/useStorageIdEntity.json +67 -0
  297. package/hooks/useStore.json +36 -0
  298. package/hooks/useTable.json +49 -0
  299. package/hooks/useTableGroup.json +43 -0
  300. package/hooks/useTableSort.json +43 -0
  301. package/hooks/useUser.json +36 -0
  302. package/hooks/useValidForm.json +43 -0
  303. package/package.json +12 -6
  304. package/dist/chunk-HPAUCD5I.js +0 -156
  305. package/dist/chunk-L4DS3EXI.mjs +0 -133
@@ -1,460 +1,527 @@
1
1
  {
2
- "id": "dialog",
3
- "name": "Dialog",
4
- "displayName": "弹窗",
5
- "category": "feedback",
6
- "description": "模态对话框,用于需要用户处理事务又不希望跳转页面的场景,支持拖拽、自定义内容和底部按钮",
7
- "importStatement": "import { Dialog, Button } from '@king-design/vue';",
8
- "props": [
9
- {
10
- "name": "value",
11
- "description": "弹窗是否展示,可用v-model双向绑定",
12
- "type": {
13
- "raw": "boolean",
14
- "kind": "boolean"
15
- },
16
- "required": false,
17
- "default": "false",
18
- "usageExample": "<Dialog v-model=\"visible\"></Dialog>"
19
- },
20
- {
21
- "name": "title",
22
- "description": "弹窗标题",
23
- "type": {
24
- "raw": "string",
25
- "kind": "string"
26
- },
27
- "required": false,
28
- "default": "\"提示\"",
29
- "usageExample": "<Dialog v-model=\"visible\" title=\"确认操作\"></Dialog>"
30
- },
31
- {
32
- "name": "size",
33
- "description": "弹窗尺寸",
34
- "type": {
35
- "raw": "\"large\" | \"default\" | \"small\" | \"mini\"",
36
- "kind": "union",
37
- "unionTypes": [
38
- "large",
39
- "default",
40
- "small",
41
- "mini"
42
- ]
43
- },
44
- "required": false,
45
- "default": "\"default\"",
46
- "allowedValues": [
47
- {
48
- "value": "large",
49
- "label": "大尺寸"
50
- },
51
- {
52
- "value": "default",
53
- "label": "默认尺寸",
54
- "isDefault": true
55
- },
56
- {
57
- "value": "small",
58
- "label": "小尺寸"
59
- },
60
- {
61
- "value": "mini",
62
- "label": "迷你尺寸"
2
+ "id": "dialog",
3
+ "name": "Dialog",
4
+ "displayName": "弹窗",
5
+ "category": "feedback",
6
+ "description": "模态对话框,用于需要用户处理事务又不希望跳转页面的场景,支持拖拽、自定义内容和底部按钮",
7
+ "importStatement": "import { Dialog, Button } from '@king-design/vue';",
8
+ "props": [
9
+ {
10
+ "name": "value",
11
+ "description": "弹窗是否展示,可用v-model双向绑定",
12
+ "type": {
13
+ "raw": "boolean",
14
+ "kind": "boolean"
15
+ },
16
+ "required": false,
17
+ "default": "false",
18
+ "usageExample": "<Dialog v-model=\"visible\">"
19
+ },
20
+ {
21
+ "name": "title",
22
+ "description": "弹窗标题",
23
+ "type": {
24
+ "raw": "string",
25
+ "kind": "string"
26
+ },
27
+ "required": false,
28
+ "default": "\"提示\"",
29
+ "usageExample": "<Dialog v-model=\"visible\" title=\"确认操作\">"
30
+ },
31
+ {
32
+ "name": "size",
33
+ "description": "弹窗尺寸",
34
+ "type": {
35
+ "raw": "\"large\" | \"default\" | \"small\" | \"mini\"",
36
+ "kind": "union",
37
+ "unionTypes": [
38
+ "large",
39
+ "default",
40
+ "small",
41
+ "mini"
42
+ ]
43
+ },
44
+ "required": false,
45
+ "default": "\"default\"",
46
+ "allowedValues": [
47
+ {
48
+ "value": "large",
49
+ "label": "大尺寸"
50
+ },
51
+ {
52
+ "value": "default",
53
+ "label": "默认尺寸",
54
+ "isDefault": true
55
+ },
56
+ {
57
+ "value": "small",
58
+ "label": "小尺寸"
59
+ },
60
+ {
61
+ "value": "mini",
62
+ "label": "迷你尺寸"
63
+ }
64
+ ],
65
+ "usageExample": "<Dialog v-model=\"visible\" size=\"small\">"
66
+ },
67
+ {
68
+ "name": "width",
69
+ "description": "指定弹窗宽度,number类型时单位为px,string类型需要指定单位",
70
+ "type": {
71
+ "raw": "number | string",
72
+ "kind": "union"
73
+ },
74
+ "required": false,
75
+ "default": "undefined",
76
+ "usageExample": "<Dialog v-model=\"visible\" :width=\"800\">"
77
+ },
78
+ {
79
+ "name": "loading",
80
+ "description": "\"确定\"按钮是否为加载状态",
81
+ "type": {
82
+ "raw": "boolean",
83
+ "kind": "boolean"
84
+ },
85
+ "required": false,
86
+ "default": "false",
87
+ "usageExample": "<Dialog v-model=\"visible\" :loading=\"isSubmitting\">"
88
+ },
89
+ {
90
+ "name": "disabledOk",
91
+ "description": "\"确定\"按钮是否为禁用状态",
92
+ "type": {
93
+ "raw": "boolean",
94
+ "kind": "boolean"
95
+ },
96
+ "required": false,
97
+ "default": "false",
98
+ "usageExample": "<Dialog v-model=\"visible\" :disabledOk=\"!isValid\">"
99
+ },
100
+ {
101
+ "name": "okText",
102
+ "description": "\"确定\"按钮文案",
103
+ "type": {
104
+ "raw": "string",
105
+ "kind": "string"
106
+ },
107
+ "required": false,
108
+ "default": "\"确定\"",
109
+ "usageExample": "<Dialog v-model=\"visible\" okText=\"保存\">"
110
+ },
111
+ {
112
+ "name": "cancelText",
113
+ "description": "\"取消\"按钮文案",
114
+ "type": {
115
+ "raw": "string",
116
+ "kind": "string"
117
+ },
118
+ "required": false,
119
+ "default": "\"取消\"",
120
+ "usageExample": "<Dialog v-model=\"visible\" cancelText=\"放弃\">"
121
+ },
122
+ {
123
+ "name": "ok",
124
+ "description": "\"确定\"按钮点击后自定义回调函数",
125
+ "type": {
126
+ "raw": "() => void",
127
+ "kind": "function",
128
+ "functionSignature": "() => void"
129
+ },
130
+ "required": false,
131
+ "default": "undefined",
132
+ "usageExample": "<Dialog v-model=\"visible\" :ok=\"handleOk\">"
133
+ },
134
+ {
135
+ "name": "cancel",
136
+ "description": "\"取消\"按钮点击后自定义回调函数",
137
+ "type": {
138
+ "raw": "() => void",
139
+ "kind": "function",
140
+ "functionSignature": "() => void"
141
+ },
142
+ "required": false,
143
+ "default": "undefined",
144
+ "usageExample": "<Dialog v-model=\"visible\" :cancel=\"handleCancel\">"
145
+ },
146
+ {
147
+ "name": "container",
148
+ "description": "指定弹窗插入的位置,默认追加到 body",
149
+ "type": {
150
+ "raw": "string | ((parentDom: Element, anchor: Node | null) => Element)",
151
+ "kind": "union"
152
+ },
153
+ "required": false,
154
+ "default": "undefined",
155
+ "usageExample": "<Dialog v-model=\"visible\" :container=\"() => document.body\">"
156
+ },
157
+ {
158
+ "name": "overlay",
159
+ "description": "是否展示遮罩层",
160
+ "type": {
161
+ "raw": "boolean",
162
+ "kind": "boolean"
163
+ },
164
+ "required": false,
165
+ "default": "true",
166
+ "usageExample": "<Dialog v-model=\"visible\" :overlay=\"false\">"
167
+ },
168
+ {
169
+ "name": "closable",
170
+ "description": "点击遮罩层是否可以关闭弹窗",
171
+ "type": {
172
+ "raw": "boolean",
173
+ "kind": "boolean"
174
+ },
175
+ "required": false,
176
+ "default": "true",
177
+ "usageExample": "<Dialog v-model=\"visible\" :closable=\"false\">"
178
+ },
179
+ {
180
+ "name": "terminate",
181
+ "description": "用户点击关闭按钮、遮罩层或按 ESC 键时的回调函数",
182
+ "type": {
183
+ "raw": "() => void",
184
+ "kind": "function",
185
+ "functionSignature": "() => void"
186
+ },
187
+ "required": false,
188
+ "default": "undefined",
189
+ "usageExample": "<Dialog v-model=\"visible\" :terminate=\"handleTerminate\">"
190
+ },
191
+ {
192
+ "name": "escClosable",
193
+ "description": "是否按ESC键关闭弹窗",
194
+ "type": {
195
+ "raw": "boolean",
196
+ "kind": "boolean"
197
+ },
198
+ "required": false,
199
+ "default": "true",
200
+ "usageExample": "<Dialog v-model=\"visible\" :escClosable=\"false\">"
201
+ },
202
+ {
203
+ "name": "hideClose",
204
+ "description": "是否隐藏右上角关闭按钮",
205
+ "type": {
206
+ "raw": "boolean",
207
+ "kind": "boolean"
208
+ },
209
+ "required": false,
210
+ "default": "false",
211
+ "usageExample": "<Dialog v-model=\"visible\" hideClose>"
212
+ },
213
+ {
214
+ "name": "draggable",
215
+ "description": "弹窗是否可拖拽",
216
+ "type": {
217
+ "raw": "boolean",
218
+ "kind": "boolean"
219
+ },
220
+ "required": false,
221
+ "default": "true",
222
+ "usageExample": "<Dialog v-model=\"visible\" :draggable=\"false\">"
223
+ },
224
+ {
225
+ "name": "mode",
226
+ "description": "指定主体元素在关闭状态下的渲染方式",
227
+ "type": {
228
+ "raw": "\"destroy\" | \"hide\"",
229
+ "kind": "union",
230
+ "unionTypes": [
231
+ "destroy",
232
+ "hide"
233
+ ]
234
+ },
235
+ "required": false,
236
+ "default": "\"hide\"",
237
+ "allowedValues": [
238
+ {
239
+ "value": "hide",
240
+ "label": "只是隐藏,保留DOM",
241
+ "isDefault": true
242
+ },
243
+ {
244
+ "value": "destroy",
245
+ "label": "直接销毁DOM"
246
+ }
247
+ ],
248
+ "usageExample": "<Dialog v-model=\"visible\" mode=\"destroy\">"
249
+ }
250
+ ],
251
+ "events": [
252
+ {
253
+ "name": "open",
254
+ "vueEventName": "@open",
255
+ "description": "弹窗打开后触发",
256
+ "payload": [],
257
+ "usageExample": "<Dialog v-model=\"visible\" @open=\"handleOpen\">",
258
+ "handlerExample": "const handleOpen = () => {\n console.log('弹窗已打开');\n};"
259
+ },
260
+ {
261
+ "name": "close",
262
+ "vueEventName": "@close",
263
+ "description": "弹窗关闭后触发,不管是什么原因导致的关闭",
264
+ "payload": [],
265
+ "usageExample": "<Dialog v-model=\"visible\" @close=\"handleClose\">",
266
+ "handlerExample": "const handleClose = () => {\n console.log('弹窗已关闭');\n};"
267
+ },
268
+ {
269
+ "name": "ok",
270
+ "vueEventName": "@ok",
271
+ "description": "点击确定按钮时触发",
272
+ "payload": [],
273
+ "usageExample": "<Dialog v-model=\"visible\" @ok=\"handleOk\">",
274
+ "handlerExample": "const handleOk = () => {\n // 处理确定逻辑\n visible.value = false;\n};"
275
+ },
276
+ {
277
+ "name": "cancel",
278
+ "vueEventName": "@cancel",
279
+ "description": "点击取消按钮时触发",
280
+ "payload": [],
281
+ "usageExample": "<Dialog v-model=\"visible\" @cancel=\"handleCancel\">",
282
+ "handlerExample": "const handleCancel = () => {\n visible.value = false;\n};"
283
+ },
284
+ {
285
+ "name": "terminate",
286
+ "vueEventName": "@terminate",
287
+ "description": "用户强行关闭弹窗时触发:点击关闭按钮、点击遮罩层、按ESC键",
288
+ "payload": [],
289
+ "usageExample": "<Dialog v-model=\"visible\" @terminate=\"handleTerminate\">",
290
+ "handlerExample": "const handleTerminate = () => {\n console.log('用户强行关闭了弹窗');\n};"
291
+ },
292
+ {
293
+ "name": "afterClose",
294
+ "vueEventName": "@after-close",
295
+ "description": "弹窗退出动画执行完成后触发",
296
+ "payload": [],
297
+ "usageExample": "<Dialog v-model=\"visible\" @after-close=\"handleAfterClose\">",
298
+ "handlerExample": "const handleAfterClose = () => {\n // 动画完成后清理\n};"
299
+ }
300
+ ],
301
+ "slots": [
302
+ {
303
+ "name": "default",
304
+ "description": "弹窗主体内容(body区域)",
305
+ "vueTemplate": "默认插槽",
306
+ "usageExample": "<Dialog v-model=\"visible\">\n <p>弹窗内容</p>\n</Dialog>"
307
+ },
308
+ {
309
+ "name": "header",
310
+ "description": "扩展弹窗头部",
311
+ "vueTemplate": "#header",
312
+ "usageExample": "<Dialog v-model=\"visible\">\n <template #header>\n <h2>自定义头部</h2>\n </template>\n</Dialog>"
313
+ },
314
+ {
315
+ "name": "footer",
316
+ "description": "扩展弹窗底部按钮区域",
317
+ "vueTemplate": "#footer",
318
+ "usageExample": "<Dialog v-model=\"visible\">\n <template #footer>\n <Button @click=\"visible = false\">关闭</Button>\n <Button type=\"primary\" @click=\"handleSubmit\">提交</Button>\n </template>\n</Dialog>"
319
+ },
320
+ {
321
+ "name": "content",
322
+ "description": "定义整个弹窗体,包括header、body、footer",
323
+ "vueTemplate": "#content",
324
+ "usageExample": "<Dialog v-model=\"visible\">\n <template #content>\n <!-- 完全自定义弹窗结构 -->\n </template>\n</Dialog>"
325
+ }
326
+ ],
327
+ "methods": [
328
+ {
329
+ "name": "show",
330
+ "description": "弹出弹窗",
331
+ "params": [
332
+ {
333
+ "name": "props",
334
+ "type": "DialogProps",
335
+ "description": "可选的临时弹窗配置,会在本次显示时覆盖标题、按钮文案或宽度等属性。",
336
+ "optional": true
337
+ }
338
+ ],
339
+ "returnType": "Promise",
340
+ "usageExample": "const dialogRef = ref<InstanceType<typeof Dialog>>();\nawait dialogRef.value?.show();"
341
+ },
342
+ {
343
+ "name": "close",
344
+ "description": "关闭弹窗",
345
+ "params": [],
346
+ "returnType": "void",
347
+ "usageExample": "dialogRef.value?.close();"
348
+ },
349
+ {
350
+ "name": "showLoading",
351
+ "description": "\"确定\"按钮变为加载状态",
352
+ "params": [],
353
+ "returnType": "void",
354
+ "usageExample": "dialogRef.value?.showLoading();"
355
+ },
356
+ {
357
+ "name": "hideLoading",
358
+ "description": "\"确定\"按钮变为正常状态",
359
+ "params": [],
360
+ "returnType": "void",
361
+ "usageExample": "dialogRef.value?.hideLoading();"
63
362
  }
64
- ],
65
- "usageExample": "<Dialog v-model=\"visible\" size=\"small\"></Dialog>"
66
- },
67
- {
68
- "name": "width",
69
- "description": "指定弹窗宽度,number类型时单位为px,string类型需要指定单位",
70
- "type": {
71
- "raw": "number | string",
72
- "kind": "union"
73
- },
74
- "required": false,
75
- "default": "undefined",
76
- "usageExample": "<Dialog v-model=\"visible\" :width=\"800\"></Dialog>"
77
- },
78
- {
79
- "name": "loading",
80
- "description": "\"确定\"按钮是否为加载状态",
81
- "type": {
82
- "raw": "boolean",
83
- "kind": "boolean"
84
- },
85
- "required": false,
86
- "default": "false",
87
- "usageExample": "<Dialog v-model=\"visible\" :loading=\"isSubmitting\"></Dialog>"
88
- },
89
- {
90
- "name": "disabledOk",
91
- "description": "\"确定\"按钮是否为禁用状态",
92
- "type": {
93
- "raw": "boolean",
94
- "kind": "boolean"
95
- },
96
- "required": false,
97
- "default": "false",
98
- "usageExample": "<Dialog v-model=\"visible\" :disabledOk=\"!isValid\"></Dialog>"
99
- },
100
- {
101
- "name": "okText",
102
- "description": "\"确定\"按钮文案",
103
- "type": {
104
- "raw": "string",
105
- "kind": "string"
106
- },
107
- "required": false,
108
- "default": "\"确定\"",
109
- "usageExample": "<Dialog v-model=\"visible\" okText=\"保存\"></Dialog>"
110
- },
111
- {
112
- "name": "cancelText",
113
- "description": "\"取消\"按钮文案",
114
- "type": {
115
- "raw": "string",
116
- "kind": "string"
117
- },
118
- "required": false,
119
- "default": "\"取消\"",
120
- "usageExample": "<Dialog v-model=\"visible\" cancelText=\"放弃\"></Dialog>"
121
- },
122
- {
123
- "name": "overlay",
124
- "description": "是否展示遮罩层",
125
- "type": {
126
- "raw": "boolean",
127
- "kind": "boolean"
128
- },
129
- "required": false,
130
- "default": "true",
131
- "usageExample": "<Dialog v-model=\"visible\" :overlay=\"false\"></Dialog>"
132
- },
133
- {
134
- "name": "closable",
135
- "description": "点击遮罩层是否可以关闭弹窗",
136
- "type": {
137
- "raw": "boolean",
138
- "kind": "boolean"
139
- },
140
- "required": false,
141
- "default": "true",
142
- "usageExample": "<Dialog v-model=\"visible\" :closable=\"false\"></Dialog>"
143
- },
144
- {
145
- "name": "escClosable",
146
- "description": "是否按ESC键关闭弹窗",
147
- "type": {
148
- "raw": "boolean",
149
- "kind": "boolean"
150
- },
151
- "required": false,
152
- "default": "true",
153
- "usageExample": "<Dialog v-model=\"visible\" :escClosable=\"false\"></Dialog>"
154
- },
155
- {
156
- "name": "hideClose",
157
- "description": "是否隐藏右上角关闭按钮",
158
- "type": {
159
- "raw": "boolean",
160
- "kind": "boolean"
161
- },
162
- "required": false,
163
- "default": "false",
164
- "usageExample": "<Dialog v-model=\"visible\" hideClose></Dialog>"
165
- },
166
- {
167
- "name": "draggable",
168
- "description": "弹窗是否可拖拽",
169
- "type": {
170
- "raw": "boolean",
171
- "kind": "boolean"
172
- },
173
- "required": false,
174
- "default": "true",
175
- "usageExample": "<Dialog v-model=\"visible\" :draggable=\"false\"></Dialog>"
176
- },
177
- {
178
- "name": "mode",
179
- "description": "指定主体元素在关闭状态下的渲染方式",
180
- "type": {
181
- "raw": "\"destroy\" | \"hide\"",
182
- "kind": "union",
183
- "unionTypes": [
184
- "destroy",
185
- "hide"
186
- ]
187
- },
188
- "required": false,
189
- "default": "\"hide\"",
190
- "allowedValues": [
191
- {
192
- "value": "hide",
193
- "label": "只是隐藏,保留DOM",
194
- "isDefault": true
195
- },
196
- {
197
- "value": "destroy",
198
- "label": "直接销毁DOM"
363
+ ],
364
+ "typeDefinitions": [
365
+ {
366
+ "name": "DialogOptions",
367
+ "definition": "interface DialogOptions {\n title?: string;\n content?: string | VNode;\n size?: 'large' | 'default' | 'small' | 'mini';\n hideIcon?: boolean;\n hideFooter?: boolean;\n okText?: string;\n cancelText?: string;\n}",
368
+ "description": "静态方法调用时的配置选项"
369
+ },
370
+ {
371
+ "name": "DialogProps",
372
+ "definition": "type DialogProps = {\n title?: string\n value?: boolean\n size?: 'large' | 'default' | 'small' | 'mini'\n width?: string | number\n loading?: boolean\n disabledOk?: boolean\n okText?: string\n cancelText?: string\n}",
373
+ "description": "实例 `show` 方法常用的弹窗属性配置片段,可覆盖标题、尺寸、宽度和按钮状态。"
374
+ }
375
+ ],
376
+ "examples": [
377
+ {
378
+ "id": "dialog_basic",
379
+ "title": "基础弹窗",
380
+ "description": "通过v-model控制弹窗显隐",
381
+ "difficulty": "easy",
382
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"提示\">\n <p>这是弹窗内容</p>\n </Dialog>\n</template>",
383
+ "tags": [
384
+ "basic",
385
+ "v-model"
386
+ ],
387
+ "usedProps": [
388
+ "value",
389
+ "title"
390
+ ],
391
+ "usedEvents": [],
392
+ "usedSlots": [
393
+ "default"
394
+ ],
395
+ "usedMethods": [],
396
+ "scenario": "创建一个基本的确认弹窗"
397
+ },
398
+ {
399
+ "id": "dialog_confirm",
400
+ "title": "确认对话框",
401
+ "description": "使用静态方法创建确认对话框",
402
+ "difficulty": "medium",
403
+ "code": "<script setup lang=\"ts\">\nimport { Dialog, Button } from '@king-design/vue';\n\nconst handleDelete = async () => {\n try {\n await Dialog.confirm({\n title: '确认删除',\n content: '确定要删除这条数据吗?此操作不可恢复。'\n });\n console.log('用户点击了确定');\n } catch (e) {\n console.log('用户点击了取消');\n }\n};\n</script>\n<template>\n <Button type=\"danger\" @click=\"handleDelete\">删除</Button>\n</template>",
404
+ "tags": [
405
+ "confirm",
406
+ "static",
407
+ "async"
408
+ ],
409
+ "usedProps": [],
410
+ "usedEvents": [],
411
+ "usedSlots": [],
412
+ "usedMethods": [],
413
+ "scenario": "使用Dialog.confirm静态方法创建删除确认对话框"
414
+ },
415
+ {
416
+ "id": "dialog_async_submit",
417
+ "title": "异步提交弹窗",
418
+ "description": "点击确定后显示loading状态",
419
+ "difficulty": "medium",
420
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\nconst loading = ref(false);\n\nconst handleOk = async () => {\n loading.value = true;\n await new Promise(resolve => setTimeout(resolve, 2000));\n loading.value = false;\n visible.value = false;\n};\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"提交数据\" :loading=\"loading\" @ok=\"handleOk\">\n <p>点击确定提交数据...</p>\n </Dialog>\n</template>",
421
+ "tags": [
422
+ "loading",
423
+ "async",
424
+ "submit"
425
+ ],
426
+ "usedProps": [
427
+ "value",
428
+ "title",
429
+ "loading"
430
+ ],
431
+ "usedEvents": [
432
+ "ok"
433
+ ],
434
+ "usedSlots": [
435
+ "default"
436
+ ],
437
+ "usedMethods": [],
438
+ "scenario": "创建带异步提交功能的弹窗,确定按钮显示loading状态"
439
+ },
440
+ {
441
+ "id": "dialog_custom_footer",
442
+ "title": "自定义底部按钮",
443
+ "description": "使用footer插槽自定义底部按钮",
444
+ "difficulty": "medium",
445
+ "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"自定义底部\">\n <p>弹窗内容</p>\n <template #footer>\n <Button @click=\"visible = false\">稍后再说</Button>\n <Button type=\"primary\" @click=\"visible = false\">立即处理</Button>\n <Button type=\"danger\" @click=\"visible = false\">删除</Button>\n </template>\n </Dialog>\n</template>",
446
+ "tags": [
447
+ "slot",
448
+ "footer",
449
+ "custom"
450
+ ],
451
+ "usedProps": [
452
+ "value",
453
+ "title"
454
+ ],
455
+ "usedEvents": [],
456
+ "usedSlots": [
457
+ "default",
458
+ "footer"
459
+ ],
460
+ "usedMethods": [],
461
+ "scenario": "创建带有多个自定义按钮的弹窗"
199
462
  }
200
- ],
201
- "usageExample": "<Dialog v-model=\"visible\" mode=\"destroy\"></Dialog>"
202
- }
203
- ],
204
- "events": [
205
- {
206
- "name": "open",
207
- "vueEventName": "@open",
208
- "description": "弹窗打开后触发",
209
- "payload": [],
210
- "usageExample": "<Dialog v-model=\"visible\" @open=\"handleOpen\"></Dialog>",
211
- "handlerExample": "const handleOpen = () => {\n console.log('弹窗已打开');\n};"
212
- },
213
- {
214
- "name": "close",
215
- "vueEventName": "@close",
216
- "description": "弹窗关闭后触发,不管是什么原因导致的关闭",
217
- "payload": [],
218
- "usageExample": "<Dialog v-model=\"visible\" @close=\"handleClose\"></Dialog>",
219
- "handlerExample": "const handleClose = () => {\n console.log('弹窗已关闭');\n};"
220
- },
221
- {
222
- "name": "ok",
223
- "vueEventName": "@ok",
224
- "description": "点击确定按钮时触发",
225
- "payload": [],
226
- "usageExample": "<Dialog v-model=\"visible\" @ok=\"handleOk\"></Dialog>",
227
- "handlerExample": "const handleOk = () => {\n // 处理确定逻辑\n visible.value = false;\n};"
228
- },
229
- {
230
- "name": "cancel",
231
- "vueEventName": "@cancel",
232
- "description": "点击取消按钮时触发",
233
- "payload": [],
234
- "usageExample": "<Dialog v-model=\"visible\" @cancel=\"handleCancel\"></Dialog>",
235
- "handlerExample": "const handleCancel = () => {\n visible.value = false;\n};"
236
- },
237
- {
238
- "name": "terminate",
239
- "vueEventName": "@terminate",
240
- "description": "用户强行关闭弹窗时触发:点击关闭按钮、点击遮罩层、按ESC键",
241
- "payload": [],
242
- "usageExample": "<Dialog v-model=\"visible\" @terminate=\"handleTerminate\"></Dialog>",
243
- "handlerExample": "const handleTerminate = () => {\n console.log('用户强行关闭了弹窗');\n};"
244
- },
245
- {
246
- "name": "afterClose",
247
- "vueEventName": "@after-close",
248
- "description": "弹窗退出动画执行完成后触发",
249
- "payload": [],
250
- "usageExample": "<Dialog v-model=\"visible\" @after-close=\"handleAfterClose\"></Dialog>",
251
- "handlerExample": "const handleAfterClose = () => {\n // 动画完成后清理\n};"
252
- }
253
- ],
254
- "slots": [
255
- {
256
- "name": "content",
257
- "description": "定义整个弹窗体,包括header,body,footer",
258
- "vueTemplate": "#content",
259
- "usageExample": "<Dialog v-model=\"visible\">\n <template #content>\n <!-- 完全自定义弹窗结构 -->\n </template>\n</Dialog>"
260
- },
261
- {
262
- "name": "header",
263
- "description": "扩展弹窗头部",
264
- "vueTemplate": "#header",
265
- "usageExample": "<Dialog v-model=\"visible\">\n <template #header>\n <h2>自定义头部</h2>\n </template>\n</Dialog>"
266
- },
267
- {
268
- "name": "body",
269
- "description": "扩展弹窗主体部分",
270
- "vueTemplate": "#body"
271
- },
272
- {
273
- "name": "footer",
274
- "description": "扩展弹窗底部",
275
- "vueTemplate": "#footer",
276
- "usageExample": "<Dialog v-model=\"visible\">\n <template #footer>\n <Button @click=\"visible = false\">关闭</Button>\n <Button type=\"primary\" @click=\"handleSubmit\">提交</Button>\n </template>\n</Dialog>"
277
- },
278
- {
279
- "name": "footerWrapper",
280
- "description": "扩展弹窗整个底部,上述footer是它下面一个子扩展点",
281
- "vueTemplate": "#footerWrapper"
282
- }
283
- ],
284
- "methods": [
285
- {
286
- "name": "show",
287
- "description": "弹出弹窗",
288
- "params": [],
289
- "returnType": "Promise",
290
- "usageExample": "const dialogRef = ref<InstanceType<typeof Dialog>>();\nawait dialogRef.value?.show();</InstanceType>"
291
- },
292
- {
293
- "name": "close",
294
- "description": "关闭弹窗",
295
- "params": [],
296
- "returnType": "void",
297
- "usageExample": "dialogRef.value?.close();"
298
- },
299
- {
300
- "name": "showLoading",
301
- "description": "\"确定\"按钮变为加载状态",
302
- "params": [],
303
- "returnType": "void",
304
- "usageExample": "dialogRef.value?.showLoading();"
305
- },
306
- {
307
- "name": "hideLoading",
308
- "description": "\"确定\"按钮变为正常状态",
309
- "params": [],
310
- "returnType": "void",
311
- "usageExample": "dialogRef.value?.hideLoading();"
312
- }
313
- ],
314
- "typeDefinitions": [
315
- {
316
- "name": "DialogOptions",
317
- "definition": "interface DialogOptions {\n title?: string;\n content?: string | VNode;\n size?: 'large' | 'default' | 'small' | 'mini';\n hideIcon?: boolean;\n hideFooter?: boolean;\n okText?: string;\n cancelText?: string;\n}",
318
- "description": "静态方法调用时的配置选项"
319
- }
320
- ],
321
- "examples": [
322
- {
323
- "id": "dialog_basic",
324
- "title": "基础弹窗",
325
- "description": "通过v-model控制弹窗显隐",
326
- "difficulty": "easy",
327
- "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"提示\">\n <p>这是弹窗内容</p>\n </Dialog>\n</template>",
328
- "tags": [
329
- "basic",
330
- "v-model"
331
- ],
332
- "usedProps": [
333
- "value",
334
- "title"
335
- ],
336
- "usedEvents": [],
337
- "usedSlots": [
338
- "default"
339
- ],
340
- "usedMethods": [],
341
- "scenario": "创建一个基本的确认弹窗"
342
- },
343
- {
344
- "id": "dialog_confirm",
345
- "title": "确认对话框",
346
- "description": "使用静态方法创建确认对话框",
347
- "difficulty": "medium",
348
- "code": "<script setup lang=\"ts\">\nimport { Dialog, Button } from '@king-design/vue';\n\nconst handleDelete = async () => {\n try {\n await Dialog.confirm({\n title: '确认删除',\n content: '确定要删除这条数据吗?此操作不可恢复。'\n });\n console.log('用户点击了确定');\n } catch (e) {\n console.log('用户点击了取消');\n }\n};\n</script>\n<template>\n <Button type=\"danger\" @click=\"handleDelete\">删除</Button>\n</template>",
349
- "tags": [
463
+ ],
464
+ "commonMistakes": [
465
+ {
466
+ "id": "dialog_static_import",
467
+ "description": "静态方法调用时未正确导入Dialog",
468
+ "wrongCode": "import { confirm } from '@king-design/vue';\nconfirm({ title: '确认' });",
469
+ "correctCode": "import { Dialog } from '@king-design/vue';\nDialog.confirm({ title: '确认' });",
470
+ "explanation": "confirm、success、warning、error是Dialog的静态方法,需要通过Dialog.xxx()调用",
471
+ "relatedProps": []
472
+ },
473
+ {
474
+ "id": "dialog_ok_event_close",
475
+ "description": "@ok事件中未关闭弹窗",
476
+ "wrongCode": "const handleOk = () => {\n // 只处理业务逻辑,忘记关闭弹窗\n submitData();\n};",
477
+ "correctCode": "const handleOk = () => {\n submitData();\n visible.value = false; // 需要手动关闭\n};",
478
+ "explanation": "使用@ok事件时,弹窗不会自动关闭,需要在处理函数中手动设置visible为false",
479
+ "relatedEvents": [
480
+ "ok"
481
+ ]
482
+ },
483
+ {
484
+ "id": "dialog_vmodel_syntax",
485
+ "description": "v-model语法错误",
486
+ "wrongCode": "<Dialog :value=\"visible\" @update:value=\"visible = $event\">",
487
+ "correctCode": "<Dialog v-model=\"visible\">",
488
+ "explanation": "Vue 3中应使用v-model语法糖,不需要手动拆分:value和@update:value",
489
+ "relatedProps": [
490
+ "value"
491
+ ]
492
+ }
493
+ ],
494
+ "searchKeywords": [
495
+ "弹窗",
496
+ "对话框",
497
+ "dialog",
498
+ "modal",
350
499
  "confirm",
351
- "static",
352
- "async"
353
- ],
354
- "usedProps": [],
355
- "usedEvents": [],
356
- "usedSlots": [],
357
- "usedMethods": [],
358
- "scenario": "使用Dialog.confirm静态方法创建删除确认对话框"
359
- },
360
- {
361
- "id": "dialog_async_submit",
362
- "title": "异步提交弹窗",
363
- "description": "点击确定后显示loading状态",
364
- "difficulty": "medium",
365
- "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\nconst loading = ref(false);\n\nconst handleOk = async () => {\n loading.value = true;\n await new Promise(resolve => setTimeout(resolve, 2000));\n loading.value = false;\n visible.value = false;\n};\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"提交数据\" :loading=\"loading\" @ok=\"handleOk\">\n <p>点击确定提交数据...</p>\n </Dialog>\n</template>",
366
- "tags": [
367
- "loading",
368
- "async",
369
- "submit"
370
- ],
371
- "usedProps": [
372
- "value",
373
- "title",
374
- "loading"
375
- ],
376
- "usedEvents": [
377
- "ok"
378
- ],
379
- "usedSlots": [
380
- "default"
381
- ],
382
- "usedMethods": [],
383
- "scenario": "创建带异步提交功能的弹窗,确定按钮显示loading状态"
384
- },
385
- {
386
- "id": "dialog_custom_footer",
387
- "title": "自定义底部按钮",
388
- "description": "使用footer插槽自定义底部按钮",
389
- "difficulty": "medium",
390
- "code": "<script setup lang=\"ts\">\nimport { ref } from 'vue';\nimport { Dialog, Button } from '@king-design/vue';\n\nconst visible = ref(false);\n</script>\n<template>\n <Button @click=\"visible = true\">打开弹窗</Button>\n <Dialog v-model=\"visible\" title=\"自定义底部\">\n <p>弹窗内容</p>\n <template #footer>\n <Button @click=\"visible = false\">稍后再说</Button>\n <Button type=\"primary\" @click=\"visible = false\">立即处理</Button>\n <Button type=\"danger\" @click=\"visible = false\">删除</Button>\n </template>\n </Dialog>\n</template>",
391
- "tags": [
392
- "slot",
393
- "footer",
394
- "custom"
395
- ],
396
- "usedProps": [
397
- "value",
398
- "title"
399
- ],
400
- "usedEvents": [],
401
- "usedSlots": [
402
- "default",
403
- "footer"
404
- ],
405
- "usedMethods": [],
406
- "scenario": "创建带有多个自定义按钮的弹窗"
407
- }
408
- ],
409
- "commonMistakes": [
410
- {
411
- "id": "dialog_static_import",
412
- "description": "静态方法调用时未正确导入Dialog",
413
- "wrongCode": "import { confirm } from '@king-design/vue';\nconfirm({ title: '确认' });",
414
- "correctCode": "import { Dialog } from '@king-design/vue';\nDialog.confirm({ title: '确认' });",
415
- "explanation": "confirm、success、warning、error是Dialog的静态方法,需要通过Dialog.xxx()调用",
416
- "relatedProps": []
417
- },
418
- {
419
- "id": "dialog_ok_event_close",
420
- "description": "@ok事件中未关闭弹窗",
421
- "wrongCode": "const handleOk = () => {\n // 只处理业务逻辑,忘记关闭弹窗\n submitData();\n};",
422
- "correctCode": "const handleOk = () => {\n submitData();\n visible.value = false; // 需要手动关闭\n};",
423
- "explanation": "使用@ok事件时,弹窗不会自动关闭,需要在处理函数中手动设置visible为false",
424
- "relatedEvents": [
425
- "ok"
426
- ]
427
- },
428
- {
429
- "id": "dialog_vmodel_syntax",
430
- "description": "v-model语法错误",
431
- "wrongCode": "<Dialog :value=\"visible\" @update:value=\"visible = $event\">",
432
- "correctCode": "<Dialog v-model=\"visible\">",
433
- "explanation": "Vue 3中应使用v-model语法糖,不需要手动拆分:value和@update:value",
434
- "relatedProps": [
435
- "value"
436
- ]
437
- }
438
- ],
439
- "searchKeywords": [
440
- "弹窗",
441
- "对话框",
442
- "dialog",
443
- "modal",
444
- "confirm",
445
- "确认",
446
- "提示",
447
- "警告"
448
- ],
449
- "useCases": [
450
- "删除确认对话框",
451
- "表单提交弹窗",
452
- "详情查看弹窗",
453
- "操作成功/失败提示",
454
- "自定义内容弹窗"
455
- ],
456
- "relatedComponents": [
457
- "Button",
458
- "Message"
459
- ]
500
+ "确认",
501
+ "提示",
502
+ "警告"
503
+ ],
504
+ "useCases": [
505
+ "删除确认对话框",
506
+ "表单提交弹窗",
507
+ "详情查看弹窗",
508
+ "操作成功/失败提示",
509
+ "自定义内容弹窗"
510
+ ],
511
+ "typeDefinitions": [
512
+ {
513
+ "name": "DialogStaticOptions",
514
+ "definition": "type DialogStaticOptions = {\\n title?: string\\n content?: string\\n okText?: string\\n cancelText?: string\\n}",
515
+ "description": "Dialog.confirm 等静态方法的常见配置结构。"
516
+ },
517
+ {
518
+ "name": "DialogSize",
519
+ "definition": "type DialogSize = 'small' | 'default' | 'large'",
520
+ "description": "弹窗尺寸枚举,用于控制对话框宽度和内部留白。"
521
+ }
522
+ ],
523
+ "relatedComponents": [
524
+ "Button",
525
+ "Message"
526
+ ]
460
527
  }