vxe-pc-ui 3.0.1 → 3.0.2

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 (367) hide show
  1. package/README.md +23 -25
  2. package/es/calendar/index.js +12 -0
  3. package/es/calendar/src/calendar.js +1227 -0
  4. package/es/calendar/style.css +247 -0
  5. package/es/calendar/style.min.css +1 -0
  6. package/es/checkbox/src/checkbox.js +6 -1
  7. package/es/checkbox/src/group.js +6 -1
  8. package/es/collapse/index.js +12 -0
  9. package/es/collapse/src/collapse-pane.js +39 -0
  10. package/es/collapse/src/collapse.js +39 -0
  11. package/es/collapse/style.css +0 -0
  12. package/es/collapse/style.min.css +0 -0
  13. package/es/collapse-pane/index.js +12 -0
  14. package/es/collapse-pane/style.css +0 -0
  15. package/es/collapse-pane/style.min.css +0 -0
  16. package/es/components.js +27 -27
  17. package/es/date-picker/src/date-picker.js +17 -13
  18. package/es/drawer/src/drawer.js +17 -12
  19. package/es/form/index.js +13 -0
  20. package/es/form/render/index.js +461 -0
  21. package/es/form/src/form-config-item.js +201 -0
  22. package/es/form/src/form-gather.js +87 -0
  23. package/es/form/src/form-item.js +291 -0
  24. package/es/form/src/form.js +762 -0
  25. package/es/form/src/itemInfo.js +43 -0
  26. package/es/form/src/render.js +78 -0
  27. package/es/form/src/util.js +66 -0
  28. package/es/form/style.css +470 -0
  29. package/es/form/style.min.css +1 -0
  30. package/es/form-gather/index.js +12 -0
  31. package/es/form-gather/style.css +0 -0
  32. package/es/form-gather/style.min.css +0 -0
  33. package/es/form-item/index.js +12 -0
  34. package/es/form-item/style.css +0 -0
  35. package/es/form-item/style.min.css +0 -0
  36. package/es/icon/style.css +1 -1
  37. package/es/icon-picker/src/icon-picker.js +5 -1
  38. package/es/image/src/preview.js +1 -2
  39. package/es/input/src/input.js +19 -15
  40. package/es/list/index.js +12 -0
  41. package/es/list/src/list.js +373 -0
  42. package/es/list/style.css +28 -0
  43. package/es/list/style.min.css +1 -0
  44. package/es/loading/src/loading.js +5 -0
  45. package/es/menu/src/menu.js +6 -2
  46. package/es/modal/src/modal.js +7 -4
  47. package/es/number-input/src/number-input.js +11 -7
  48. package/es/pager/style.css +303 -0
  49. package/es/pager/style.min.css +1 -0
  50. package/es/password-input/src/password-input.js +7 -3
  51. package/es/pulldown/src/pulldown.js +6 -2
  52. package/es/radio/src/button.js +6 -2
  53. package/es/radio/src/group.js +6 -2
  54. package/es/radio/src/radio.js +6 -2
  55. package/es/select/src/select.js +16 -1
  56. package/es/select/src/util.js +2 -1
  57. package/es/style.css +1 -1
  58. package/es/style.min.css +1 -1
  59. package/es/switch/src/switch.js +6 -2
  60. package/es/tabs/src/tabs.js +8 -3
  61. package/es/textarea/src/textarea.js +9 -5
  62. package/es/tooltip/src/tooltip.js +6 -1
  63. package/es/tree/index.js +12 -0
  64. package/es/tree/src/tree.js +1216 -0
  65. package/es/tree/style.css +219 -0
  66. package/es/tree/style.min.css +1 -0
  67. package/es/tree-select/index.js +12 -0
  68. package/es/tree-select/src/tree-select.js +685 -0
  69. package/es/tree-select/style.css +129 -0
  70. package/es/tree-select/style.min.css +1 -0
  71. package/es/ui/index.js +1 -1
  72. package/es/ui/src/log.js +1 -1
  73. package/es/ui/src/vn.js +1 -1
  74. package/es/upload/src/upload.js +9 -5
  75. package/es/vxe-calendar/index.js +3 -0
  76. package/es/vxe-calendar/style.css +247 -0
  77. package/es/vxe-calendar/style.min.css +1 -0
  78. package/es/vxe-collapse/index.js +3 -0
  79. package/es/vxe-collapse/style.css +0 -0
  80. package/es/vxe-collapse/style.min.css +0 -0
  81. package/es/vxe-collapse-pane/index.js +3 -0
  82. package/es/vxe-collapse-pane/style.css +0 -0
  83. package/es/vxe-collapse-pane/style.min.css +0 -0
  84. package/es/vxe-form/index.js +3 -0
  85. package/es/vxe-form/style.css +470 -0
  86. package/es/vxe-form/style.min.css +1 -0
  87. package/es/vxe-form-gather/index.js +3 -0
  88. package/es/vxe-form-gather/style.css +0 -0
  89. package/es/vxe-form-gather/style.min.css +0 -0
  90. package/es/vxe-form-item/index.js +3 -0
  91. package/es/vxe-form-item/style.css +0 -0
  92. package/es/vxe-form-item/style.min.css +0 -0
  93. package/es/vxe-list/index.js +3 -0
  94. package/es/vxe-list/style.css +28 -0
  95. package/es/vxe-list/style.min.css +1 -0
  96. package/es/vxe-pager/index.js +3 -0
  97. package/es/vxe-pager/style.css +303 -0
  98. package/es/vxe-pager/style.min.css +1 -0
  99. package/es/vxe-tree/index.js +3 -0
  100. package/es/vxe-tree/style.css +219 -0
  101. package/es/vxe-tree/style.min.css +1 -0
  102. package/es/vxe-tree-select/index.js +3 -0
  103. package/es/vxe-tree-select/style.css +129 -0
  104. package/es/vxe-tree-select/style.min.css +1 -0
  105. package/lib/calendar/index.js +19 -0
  106. package/lib/calendar/index.min.js +1 -0
  107. package/lib/calendar/src/calendar.js +1286 -0
  108. package/lib/calendar/src/calendar.min.js +1 -0
  109. package/lib/calendar/style/index.js +1 -0
  110. package/lib/calendar/style/style.css +247 -0
  111. package/lib/calendar/style/style.min.css +1 -0
  112. package/lib/checkbox/src/checkbox.js +6 -1
  113. package/lib/checkbox/src/checkbox.min.js +1 -1
  114. package/lib/checkbox/src/group.js +6 -1
  115. package/lib/checkbox/src/group.min.js +1 -1
  116. package/lib/collapse/index.js +19 -0
  117. package/lib/collapse/index.min.js +1 -0
  118. package/lib/collapse/src/collapse-pane.js +48 -0
  119. package/lib/collapse/src/collapse-pane.min.js +1 -0
  120. package/lib/collapse/src/collapse.js +48 -0
  121. package/lib/collapse/src/collapse.min.js +1 -0
  122. package/lib/collapse/style/index.js +1 -0
  123. package/lib/collapse/style/style.css +0 -0
  124. package/lib/collapse/style/style.min.css +0 -0
  125. package/lib/collapse-pane/index.js +19 -0
  126. package/lib/collapse-pane/index.min.js +1 -0
  127. package/lib/collapse-pane/style/index.js +1 -0
  128. package/lib/collapse-pane/style/style.css +0 -0
  129. package/lib/collapse-pane/style/style.min.css +0 -0
  130. package/lib/components.js +114 -39
  131. package/lib/components.min.js +1 -1
  132. package/lib/date-picker/src/date-picker.js +17 -13
  133. package/lib/date-picker/src/date-picker.min.js +1 -1
  134. package/lib/drawer/src/drawer.js +17 -12
  135. package/lib/drawer/src/drawer.min.js +1 -1
  136. package/lib/form/index.js +20 -0
  137. package/lib/form/index.min.js +1 -0
  138. package/lib/form/render/index.js +509 -0
  139. package/lib/form/render/index.min.js +1 -0
  140. package/lib/form/src/form-config-item.js +210 -0
  141. package/lib/form/src/form-config-item.min.js +1 -0
  142. package/lib/form/src/form-gather.js +99 -0
  143. package/lib/form/src/form-gather.min.js +1 -0
  144. package/lib/form/src/form-item.js +299 -0
  145. package/lib/form/src/form-item.min.js +1 -0
  146. package/lib/form/src/form.js +856 -0
  147. package/lib/form/src/form.min.js +1 -0
  148. package/lib/form/src/itemInfo.js +60 -0
  149. package/lib/form/src/itemInfo.min.js +1 -0
  150. package/lib/form/src/render.js +94 -0
  151. package/lib/form/src/render.min.js +1 -0
  152. package/lib/form/src/util.js +93 -0
  153. package/lib/form/src/util.min.js +1 -0
  154. package/lib/form/style/index.js +1 -0
  155. package/lib/form/style/style.css +470 -0
  156. package/lib/form/style/style.min.css +1 -0
  157. package/lib/form-gather/index.js +19 -0
  158. package/lib/form-gather/index.min.js +1 -0
  159. package/lib/form-gather/style/index.js +1 -0
  160. package/lib/form-gather/style/style.css +0 -0
  161. package/lib/form-gather/style/style.min.css +0 -0
  162. package/lib/form-item/index.js +19 -0
  163. package/lib/form-item/index.min.js +1 -0
  164. package/lib/form-item/style/index.js +1 -0
  165. package/lib/form-item/style/style.css +0 -0
  166. package/lib/form-item/style/style.min.css +0 -0
  167. package/lib/icon/style/style.css +1 -1
  168. package/lib/icon/style/style.min.css +1 -1
  169. package/lib/icon-picker/src/icon-picker.js +5 -1
  170. package/lib/icon-picker/src/icon-picker.min.js +1 -1
  171. package/lib/image/src/preview.js +1 -2
  172. package/lib/image/src/preview.min.js +1 -1
  173. package/lib/index.umd.js +11284 -5009
  174. package/lib/index.umd.min.js +1 -1
  175. package/lib/input/src/input.js +19 -15
  176. package/lib/input/src/input.min.js +1 -1
  177. package/lib/list/index.js +19 -0
  178. package/lib/list/index.min.js +1 -0
  179. package/lib/list/src/list.js +415 -0
  180. package/lib/list/src/list.min.js +1 -0
  181. package/lib/list/style/index.js +1 -0
  182. package/lib/list/style/style.css +28 -0
  183. package/lib/list/style/style.min.css +1 -0
  184. package/lib/loading/src/loading.js +5 -0
  185. package/lib/loading/src/loading.min.js +1 -1
  186. package/lib/menu/src/menu.js +6 -2
  187. package/lib/menu/src/menu.min.js +1 -1
  188. package/lib/modal/src/modal.js +7 -4
  189. package/lib/modal/src/modal.min.js +1 -1
  190. package/lib/number-input/src/number-input.js +11 -7
  191. package/lib/number-input/src/number-input.min.js +1 -1
  192. package/lib/pager/style/index.js +1 -0
  193. package/lib/pager/style/style.css +303 -0
  194. package/lib/pager/style/style.min.css +1 -0
  195. package/lib/password-input/src/password-input.js +7 -3
  196. package/lib/password-input/src/password-input.min.js +1 -1
  197. package/lib/pulldown/src/pulldown.js +6 -2
  198. package/lib/pulldown/src/pulldown.min.js +1 -1
  199. package/lib/radio/src/button.js +6 -2
  200. package/lib/radio/src/button.min.js +1 -1
  201. package/lib/radio/src/group.js +6 -2
  202. package/lib/radio/src/group.min.js +1 -1
  203. package/lib/radio/src/radio.js +6 -2
  204. package/lib/radio/src/radio.min.js +1 -1
  205. package/lib/select/src/select.js +16 -1
  206. package/lib/select/src/select.min.js +1 -1
  207. package/lib/select/src/util.js +2 -1
  208. package/lib/style.css +1 -1
  209. package/lib/style.min.css +1 -1
  210. package/lib/switch/src/switch.js +6 -2
  211. package/lib/switch/src/switch.min.js +1 -1
  212. package/lib/tabs/src/tabs.js +8 -3
  213. package/lib/tabs/src/tabs.min.js +1 -1
  214. package/lib/textarea/src/textarea.js +9 -5
  215. package/lib/textarea/src/textarea.min.js +1 -1
  216. package/lib/tooltip/src/tooltip.js +6 -1
  217. package/lib/tooltip/src/tooltip.min.js +1 -1
  218. package/lib/tree/index.js +19 -0
  219. package/lib/tree/index.min.js +1 -0
  220. package/lib/tree/src/tree.js +1324 -0
  221. package/lib/tree/src/tree.min.js +1 -0
  222. package/lib/tree/style/index.js +1 -0
  223. package/lib/tree/style/style.css +219 -0
  224. package/lib/tree/style/style.min.css +1 -0
  225. package/lib/tree-select/index.js +19 -0
  226. package/lib/tree-select/index.min.js +1 -0
  227. package/lib/tree-select/src/tree-select.js +695 -0
  228. package/lib/tree-select/src/tree-select.min.js +1 -0
  229. package/lib/tree-select/style/index.js +1 -0
  230. package/lib/tree-select/style/style.css +129 -0
  231. package/lib/tree-select/style/style.min.css +1 -0
  232. package/lib/ui/index.js +1 -1
  233. package/lib/ui/index.min.js +1 -1
  234. package/lib/ui/src/log.js +1 -1
  235. package/lib/ui/src/log.min.js +1 -1
  236. package/lib/ui/src/vn.js +1 -1
  237. package/lib/ui/src/vn.min.js +1 -1
  238. package/lib/upload/src/upload.js +9 -5
  239. package/lib/upload/src/upload.min.js +1 -1
  240. package/lib/vxe-calendar/index.js +23 -0
  241. package/lib/vxe-calendar/index.min.js +1 -0
  242. package/lib/vxe-calendar/style/index.js +1 -0
  243. package/lib/vxe-calendar/style/style.css +247 -0
  244. package/lib/vxe-calendar/style/style.min.css +1 -0
  245. package/lib/vxe-collapse/index.js +23 -0
  246. package/lib/vxe-collapse/index.min.js +1 -0
  247. package/lib/vxe-collapse/style/index.js +1 -0
  248. package/lib/vxe-collapse/style/style.css +0 -0
  249. package/lib/vxe-collapse/style/style.min.css +0 -0
  250. package/lib/vxe-collapse-pane/index.js +23 -0
  251. package/lib/vxe-collapse-pane/index.min.js +1 -0
  252. package/lib/vxe-collapse-pane/style/index.js +1 -0
  253. package/lib/vxe-collapse-pane/style/style.css +0 -0
  254. package/lib/vxe-collapse-pane/style/style.min.css +0 -0
  255. package/lib/vxe-form/index.js +23 -0
  256. package/lib/vxe-form/index.min.js +1 -0
  257. package/lib/vxe-form/style/index.js +1 -0
  258. package/lib/vxe-form/style/style.css +470 -0
  259. package/lib/vxe-form/style/style.min.css +1 -0
  260. package/lib/vxe-form-gather/index.js +23 -0
  261. package/lib/vxe-form-gather/index.min.js +1 -0
  262. package/lib/vxe-form-gather/style/index.js +1 -0
  263. package/lib/vxe-form-gather/style/style.css +0 -0
  264. package/lib/vxe-form-gather/style/style.min.css +0 -0
  265. package/lib/vxe-form-item/index.js +23 -0
  266. package/lib/vxe-form-item/index.min.js +1 -0
  267. package/lib/vxe-form-item/style/index.js +1 -0
  268. package/lib/vxe-form-item/style/style.css +0 -0
  269. package/lib/vxe-form-item/style/style.min.css +0 -0
  270. package/lib/vxe-list/index.js +23 -0
  271. package/lib/vxe-list/index.min.js +1 -0
  272. package/lib/vxe-list/style/index.js +1 -0
  273. package/lib/vxe-list/style/style.css +28 -0
  274. package/lib/vxe-list/style/style.min.css +1 -0
  275. package/lib/vxe-pager/index.js +23 -0
  276. package/lib/vxe-pager/index.min.js +1 -0
  277. package/lib/vxe-pager/style/index.js +1 -0
  278. package/lib/vxe-pager/style/style.css +303 -0
  279. package/lib/vxe-pager/style/style.min.css +1 -0
  280. package/lib/vxe-tree/index.js +23 -0
  281. package/lib/vxe-tree/index.min.js +1 -0
  282. package/lib/vxe-tree/style/index.js +1 -0
  283. package/lib/vxe-tree/style/style.css +219 -0
  284. package/lib/vxe-tree/style/style.min.css +1 -0
  285. package/lib/vxe-tree-select/index.js +23 -0
  286. package/lib/vxe-tree-select/index.min.js +1 -0
  287. package/lib/vxe-tree-select/style/index.js +1 -0
  288. package/lib/vxe-tree-select/style/style.css +129 -0
  289. package/lib/vxe-tree-select/style/style.min.css +1 -0
  290. package/package.json +1 -1
  291. package/packages/calendar/index.ts +16 -0
  292. package/packages/calendar/src/calendar.ts +1281 -0
  293. package/packages/checkbox/src/checkbox.ts +7 -1
  294. package/packages/checkbox/src/group.ts +8 -2
  295. package/packages/collapse/index.ts +16 -0
  296. package/packages/collapse/src/collapse-pane.ts +47 -0
  297. package/packages/collapse/src/collapse.ts +47 -0
  298. package/packages/collapse-pane/index.ts +16 -0
  299. package/packages/components.ts +27 -27
  300. package/packages/date-picker/src/date-picker.ts +18 -13
  301. package/packages/drawer/src/drawer.ts +18 -12
  302. package/packages/form/index.ts +17 -0
  303. package/packages/form/render/index.ts +499 -0
  304. package/packages/form/src/form-config-item.ts +219 -0
  305. package/packages/form/src/form-gather.ts +104 -0
  306. package/packages/form/src/form-item.ts +322 -0
  307. package/packages/form/src/form.ts +809 -0
  308. package/packages/form/src/itemInfo.ts +47 -0
  309. package/packages/form/src/render.ts +98 -0
  310. package/packages/form/src/util.ts +80 -0
  311. package/packages/form-gather/index.ts +16 -0
  312. package/packages/form-item/index.ts +16 -0
  313. package/packages/icon-picker/src/icon-picker.ts +6 -1
  314. package/packages/image/src/preview.ts +1 -2
  315. package/packages/input/src/input.ts +20 -15
  316. package/packages/layout-footer/src/layout-footer.ts +1 -0
  317. package/packages/list/index.ts +16 -0
  318. package/packages/list/src/list.ts +403 -0
  319. package/packages/loading/src/loading.ts +6 -0
  320. package/packages/menu/src/menu.ts +7 -2
  321. package/packages/modal/src/modal.ts +8 -4
  322. package/packages/number-input/src/number-input.ts +12 -7
  323. package/packages/password-input/src/password-input.ts +8 -3
  324. package/packages/pulldown/src/pulldown.ts +7 -2
  325. package/packages/radio/src/button.ts +7 -2
  326. package/packages/radio/src/group.ts +7 -2
  327. package/packages/radio/src/radio.ts +7 -2
  328. package/packages/select/src/select.ts +17 -1
  329. package/packages/select/src/util.ts +4 -3
  330. package/packages/switch/src/switch.ts +7 -2
  331. package/packages/tabs/src/tabs.ts +9 -3
  332. package/packages/textarea/src/textarea.ts +10 -5
  333. package/packages/tooltip/src/tooltip.ts +7 -1
  334. package/packages/tree/index.ts +16 -0
  335. package/packages/tree/src/tree.ts +1292 -0
  336. package/packages/tree-select/index.ts +16 -0
  337. package/packages/tree-select/src/tree-select.ts +743 -0
  338. package/packages/ui/src/vn.ts +1 -1
  339. package/packages/upload/src/upload.ts +10 -5
  340. package/types/components/calendar.d.ts +6 -0
  341. package/types/components/colgroup.d.ts +1 -0
  342. package/types/components/column.d.ts +1 -0
  343. package/types/components/drawer.d.ts +11 -10
  344. package/types/components/form-item.d.ts +1 -1
  345. package/types/components/form.d.ts +8 -1
  346. package/types/components/list.d.ts +1 -0
  347. package/types/components/table.d.ts +43 -4
  348. package/types/components/toolbar.d.ts +5 -0
  349. package/types/components/tree-select.d.ts +4 -0
  350. package/types/ui/index.d.ts +0 -5
  351. package/types/ui/renderer.d.ts +37 -36
  352. package/types/handles/form-design.d.ts +0 -4
  353. package/types/handles/index.d.ts +0 -3
  354. package/types/handles/list-design.d.ts +0 -4
  355. package/types/handles/table.d.ts +0 -4
  356. /package/es/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
  357. /package/es/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
  358. /package/es/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
  359. /package/es/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
  360. /package/es/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
  361. /package/es/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
  362. /package/lib/icon/style/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
  363. /package/lib/icon/style/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
  364. /package/lib/icon/style/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
  365. /package/lib/{iconfont.1725723159302.ttf → iconfont.1725869586078.ttf} +0 -0
  366. /package/lib/{iconfont.1725723159302.woff → iconfont.1725869586078.woff} +0 -0
  367. /package/lib/{iconfont.1725723159302.woff2 → iconfont.1725869586078.woff2} +0 -0
@@ -0,0 +1,403 @@
1
+ import { PropType, CreateElement, VNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import XEUtils from 'xe-utils'
4
+ import { getConfig, globalEvents, globalResize, createEvent, globalMixins } from '../../ui'
5
+ import { browse } from '../../ui/src/dom'
6
+ import VxeLoadingComponent from '../../loading/src/loading'
7
+
8
+ import type { VxeListPropTypes, VxeListEmits, VxeComponentSizeType, ListReactData, ValueOf, ListInternalData } from '../../../types'
9
+
10
+ export default defineVxeComponent({
11
+ name: 'VxeList',
12
+ mixins: [
13
+ globalMixins.sizeMixin
14
+ ],
15
+ props: {
16
+ data: Array as PropType<VxeListPropTypes.Data>,
17
+ height: [Number, String] as PropType<VxeListPropTypes.Height>,
18
+ maxHeight: [Number, String] as PropType<VxeListPropTypes.MaxHeight>,
19
+ loading: Boolean as PropType<VxeListPropTypes.Loading>,
20
+ className: [String, Function] as PropType<VxeListPropTypes.ClassName>,
21
+ size: { type: String as PropType<VxeListPropTypes.Size>, default: () => getConfig().list.size || getConfig().size },
22
+ autoResize: { type: Boolean as PropType<VxeListPropTypes.AutoResize>, default: () => getConfig().list.autoResize },
23
+ syncResize: [Boolean, String, Number] as PropType<VxeListPropTypes.SyncResize>,
24
+ scrollY: Object as PropType<VxeListPropTypes.ScrollY>
25
+ },
26
+ data () {
27
+ const xID = XEUtils.uniqueId()
28
+ const reactData: ListReactData = {
29
+ scrollYLoad: false,
30
+ bodyHeight: 0,
31
+ rowHeight: 0,
32
+ topSpaceHeight: 0,
33
+ items: []
34
+ }
35
+ const internalData: ListInternalData = {
36
+ resizeObserver: undefined,
37
+ fullData: [],
38
+ lastScrollLeft: 0,
39
+ lastScrollTop: 0,
40
+ scrollYStore: {
41
+ startIndex: 0,
42
+ endIndex: 0,
43
+ visibleSize: 0,
44
+ offsetSize: 0,
45
+ rowHeight: 0
46
+ }
47
+ }
48
+ return {
49
+ xID,
50
+ reactData,
51
+ internalData
52
+ }
53
+ },
54
+ computed: {
55
+ ...({} as {
56
+ computeSize(): VxeComponentSizeType
57
+ }),
58
+ computeSYOpts () {
59
+ const $xeList = this
60
+ const props = $xeList
61
+
62
+ return Object.assign({} as { gt: number }, getConfig().list.scrollY, props.scrollY)
63
+ },
64
+ computeStyles () {
65
+ const $xeList = this
66
+ const props = $xeList
67
+
68
+ const { height, maxHeight } = props
69
+ const style: { [key: string]: string | number } = {}
70
+ if (height) {
71
+ style.height = `${isNaN(height as number) ? height : `${height}px`}`
72
+ } else if (maxHeight) {
73
+ style.height = 'auto'
74
+ style.maxHeight = `${isNaN(maxHeight as number) ? maxHeight : `${maxHeight}px`}`
75
+ }
76
+ return style
77
+ }
78
+
79
+ },
80
+ methods: {
81
+ //
82
+ // Method
83
+ //
84
+ dispatchEvent (type: ValueOf<VxeListEmits>, params: Record<string, any>, evnt: Event | null) {
85
+ const $xeList = this
86
+ $xeList.$emit(type, createEvent(evnt, { $list: $xeList }, params))
87
+ },
88
+ /**
89
+ * 加载数据
90
+ * @param {Array} datas 数据
91
+ */
92
+ loadData (datas: any) {
93
+ const $xeList = this
94
+ const reactData = $xeList.reactData
95
+ const internalData = $xeList.internalData
96
+
97
+ const { scrollYStore } = internalData
98
+ const sYOpts = $xeList.computeSYOpts
99
+ const fullData = datas || []
100
+ Object.assign(scrollYStore, {
101
+ startIndex: 0,
102
+ endIndex: 1,
103
+ visibleSize: 0
104
+ })
105
+ internalData.fullData = fullData
106
+ // 如果gt为0,则总是启用
107
+ reactData.scrollYLoad = !!sYOpts.enabled && sYOpts.gt > -1 && (sYOpts.gt === 0 || sYOpts.gt <= fullData.length)
108
+ $xeList.handleData()
109
+ return $xeList.computeScrollLoad().then(() => {
110
+ $xeList.refreshScroll()
111
+ })
112
+ },
113
+ /**
114
+ * 重新加载数据
115
+ * @param {Array} datas 数据
116
+ */
117
+ reloadData (datas: any) {
118
+ const $xeList = this
119
+
120
+ $xeList.clearScroll()
121
+ return $xeList.loadData(datas)
122
+ },
123
+ updateYSpace () {
124
+ const $xeList = this
125
+ const reactData = $xeList.reactData
126
+ const internalData = $xeList.internalData
127
+
128
+ const { scrollYLoad } = reactData
129
+ const { scrollYStore, fullData } = internalData
130
+ reactData.bodyHeight = scrollYLoad ? fullData.length * scrollYStore.rowHeight : 0
131
+ reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0
132
+ },
133
+ handleData () {
134
+ const $xeList = this
135
+ const reactData = $xeList.reactData
136
+ const internalData = $xeList.internalData
137
+
138
+ const { scrollYLoad } = reactData
139
+ const { fullData, scrollYStore } = internalData
140
+ reactData.items = scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.endIndex) : fullData.slice(0)
141
+ return $xeList.$nextTick()
142
+ },
143
+ updateYData () {
144
+ const $xeList = this
145
+
146
+ $xeList.handleData()
147
+ $xeList.updateYSpace()
148
+ },
149
+ computeScrollLoad () {
150
+ const $xeList = this
151
+ const reactData = $xeList.reactData
152
+ const internalData = $xeList.internalData
153
+
154
+ return $xeList.$nextTick().then(() => {
155
+ const { scrollYLoad } = reactData
156
+ const { scrollYStore } = internalData
157
+ const virtualBodyElem = $xeList.$refs.refVirtualBody as HTMLElement
158
+ const sYOpts = $xeList.computeSYOpts
159
+ let rowHeight = 0
160
+ let firstItemElem: HTMLElement | undefined
161
+ if (virtualBodyElem) {
162
+ if (sYOpts.sItem) {
163
+ firstItemElem = virtualBodyElem.querySelector(sYOpts.sItem) as HTMLElement
164
+ }
165
+ if (!firstItemElem) {
166
+ firstItemElem = virtualBodyElem.children[0] as HTMLElement
167
+ }
168
+ }
169
+ if (firstItemElem) {
170
+ rowHeight = firstItemElem.offsetHeight
171
+ }
172
+ rowHeight = Math.max(20, rowHeight)
173
+ scrollYStore.rowHeight = rowHeight
174
+ // 计算 Y 逻辑
175
+ if (scrollYLoad) {
176
+ const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
177
+ const visibleYSize = Math.max(8, Math.ceil(scrollBodyElem.clientHeight / rowHeight))
178
+ const offsetYSize = sYOpts.oSize ? XEUtils.toNumber(sYOpts.oSize) : (browse.edge ? 10 : 0)
179
+ scrollYStore.offsetSize = offsetYSize
180
+ scrollYStore.visibleSize = visibleYSize
181
+ scrollYStore.endIndex = Math.max(scrollYStore.startIndex, visibleYSize + offsetYSize, scrollYStore.endIndex)
182
+ $xeList.updateYData()
183
+ } else {
184
+ $xeList.updateYSpace()
185
+ }
186
+ reactData.rowHeight = rowHeight
187
+ })
188
+ },
189
+ /**
190
+ * 清除滚动条
191
+ */
192
+ clearScroll () {
193
+ const $xeList = this
194
+
195
+ const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
196
+ if (scrollBodyElem) {
197
+ scrollBodyElem.scrollTop = 0
198
+ }
199
+ return $xeList.$nextTick()
200
+ },
201
+ /**
202
+ * 如果有滚动条,则滚动到对应的位置
203
+ * @param {Number} scrollLeft 左距离
204
+ * @param {Number} scrollTop 上距离
205
+ */
206
+ scrollTo (scrollLeft: number | null, scrollTop?: number | null) {
207
+ const $xeList = this
208
+ const reactData = $xeList.reactData
209
+
210
+ const scrollBodyElem = $xeList.$refs.refVirtualWrapper as HTMLElement
211
+ if (XEUtils.isNumber(scrollLeft)) {
212
+ scrollBodyElem.scrollLeft = scrollLeft
213
+ }
214
+ if (XEUtils.isNumber(scrollTop)) {
215
+ scrollBodyElem.scrollTop = scrollTop
216
+ }
217
+ if (reactData.scrollYLoad) {
218
+ return new Promise<void>(resolve => {
219
+ setTimeout(() => {
220
+ $xeList.$nextTick(() => {
221
+ resolve()
222
+ })
223
+ }, 50)
224
+ })
225
+ }
226
+ return $xeList.$nextTick()
227
+ },
228
+ /**
229
+ * 刷新滚动条
230
+ */
231
+ refreshScroll () {
232
+ const $xeList = this
233
+ const internalData = $xeList.internalData
234
+
235
+ const { lastScrollLeft, lastScrollTop } = internalData
236
+ return $xeList.clearScroll().then(() => {
237
+ if (lastScrollLeft || lastScrollTop) {
238
+ internalData.lastScrollLeft = 0
239
+ internalData.lastScrollTop = 0
240
+ return scrollTo(lastScrollLeft, lastScrollTop)
241
+ }
242
+ })
243
+ },
244
+ /**
245
+ * 重新计算列表
246
+ */
247
+ recalculate () {
248
+ const $xeList = this
249
+
250
+ const el = $xeList.$refs.refElem as HTMLDivElement
251
+ if (el.clientWidth && el.clientHeight) {
252
+ return $xeList.computeScrollLoad()
253
+ }
254
+ return Promise.resolve()
255
+ },
256
+ loadYData (evnt: Event) {
257
+ const $xeList = this
258
+ const internalData = $xeList.internalData
259
+
260
+ const { scrollYStore } = internalData
261
+ const { startIndex, endIndex, visibleSize, offsetSize, rowHeight } = scrollYStore
262
+ const scrollBodyElem = evnt.target as HTMLDivElement
263
+ const scrollTop = scrollBodyElem.scrollTop
264
+ const toVisibleIndex = Math.floor(scrollTop / rowHeight)
265
+ const offsetStartIndex = Math.max(0, toVisibleIndex - 1 - offsetSize)
266
+ const offsetEndIndex = toVisibleIndex + visibleSize + offsetSize
267
+ if (toVisibleIndex <= startIndex || toVisibleIndex >= endIndex - visibleSize - 1) {
268
+ if (startIndex !== offsetStartIndex || endIndex !== offsetEndIndex) {
269
+ scrollYStore.startIndex = offsetStartIndex
270
+ scrollYStore.endIndex = offsetEndIndex
271
+ $xeList.updateYData()
272
+ }
273
+ }
274
+ },
275
+ scrollEvent (evnt: Event) {
276
+ const $xeList = this
277
+ const reactData = $xeList.reactData
278
+ const internalData = $xeList.internalData
279
+
280
+ const scrollBodyElem = evnt.target as HTMLDivElement
281
+ const scrollTop = scrollBodyElem.scrollTop
282
+ const scrollLeft = scrollBodyElem.scrollLeft
283
+ const isX = scrollLeft !== internalData.lastScrollLeft
284
+ const isY = scrollTop !== internalData.lastScrollTop
285
+ internalData.lastScrollTop = scrollTop
286
+ internalData.lastScrollLeft = scrollLeft
287
+ if (reactData.scrollYLoad) {
288
+ $xeList.loadYData(evnt)
289
+ }
290
+ $xeList.dispatchEvent('scroll', { scrollLeft, scrollTop, isX, isY }, evnt)
291
+ },
292
+
293
+ //
294
+ // Render
295
+ //
296
+ renderVN (h: CreateElement): VNode {
297
+ const $xeList = this
298
+ const props = $xeList
299
+ const reactData = $xeList.reactData
300
+ const slots = $xeList.$scopedSlots
301
+
302
+ const { className, loading } = props
303
+ const { bodyHeight, topSpaceHeight, items } = reactData
304
+ const defaultSlot = slots.default
305
+ const vSize = $xeList.computeSize
306
+ const styles = $xeList.computeStyles
307
+ return h('div', {
308
+ ref: 'refElem',
309
+ class: ['vxe-list', className ? (XEUtils.isFunction(className) ? className({ $list: $xeList }) : className) : '', {
310
+ [`size--${vSize}`]: vSize,
311
+ 'is--loading': loading
312
+ }]
313
+ }, [
314
+ h('div', {
315
+ ref: 'refVirtualWrapper',
316
+ class: 'vxe-list--virtual-wrapper',
317
+ style: styles,
318
+ on: {
319
+ scroll: $xeList.scrollEvent
320
+ }
321
+ }, [
322
+ h('div', {
323
+ class: 'vxe-list--y-space',
324
+ style: {
325
+ height: bodyHeight ? `${bodyHeight}px` : ''
326
+ }
327
+ }),
328
+ h('div', {
329
+ ref: 'refVirtualBody',
330
+ class: 'vxe-list--body',
331
+ style: {
332
+ marginTop: topSpaceHeight ? `${topSpaceHeight}px` : ''
333
+ }
334
+ }, defaultSlot ? defaultSlot({ items, $list: $xeList }) : [])
335
+ ]),
336
+ /**
337
+ * 加载中
338
+ */
339
+ h(VxeLoadingComponent, {
340
+ class: 'vxe-list--loading',
341
+ props: {
342
+ value: loading
343
+ }
344
+ })
345
+ ])
346
+ }
347
+ },
348
+ watch: {
349
+ data () {
350
+ const $xeList = this
351
+ const props = $xeList
352
+
353
+ $xeList.loadData(props.data || [])
354
+ },
355
+ syncResize (val) {
356
+ const $xeList = this
357
+
358
+ if (val) {
359
+ $xeList.recalculate()
360
+ $xeList.$nextTick(() => setTimeout(() => $xeList.recalculate()))
361
+ }
362
+ }
363
+ },
364
+ created () {
365
+ const $xeList = this
366
+ const props = $xeList
367
+
368
+ globalEvents.on($xeList, 'resize', () => {
369
+ $xeList.recalculate()
370
+ })
371
+ $xeList.loadData(props.data || [])
372
+ },
373
+ mounted () {
374
+ const $xeList = this
375
+ const props = $xeList
376
+ const internalData = $xeList.internalData
377
+
378
+ if (props.autoResize) {
379
+ const el = $xeList.$refs.refElem as HTMLDivElement
380
+ const resizeObserver = globalResize.create(() => $xeList.recalculate())
381
+ resizeObserver.observe(el)
382
+ internalData.resizeObserver = resizeObserver
383
+ }
384
+ },
385
+ activated () {
386
+ const $xeList = this
387
+
388
+ $xeList.recalculate().then(() => $xeList.refreshScroll())
389
+ },
390
+ beforeDestroy () {
391
+ const $xeList = this
392
+ const internalData = $xeList.internalData
393
+
394
+ const { resizeObserver } = internalData
395
+ if (resizeObserver) {
396
+ resizeObserver.disconnect()
397
+ }
398
+ globalEvents.off($xeList, 'resize')
399
+ },
400
+ render (this: any, h) {
401
+ return this.renderVN(h)
402
+ }
403
+ })
@@ -76,6 +76,12 @@ export default defineVxeComponent({
76
76
  const $xeLoading = this
77
77
  $xeLoading.$emit(type, createEvent(evnt, { $loading: $xeLoading }, params))
78
78
  },
79
+ emitModel (value: any) {
80
+ const $xeLoading = this
81
+
82
+ $xeLoading.$emit('input', value)
83
+ $xeLoading.$emit('modelValue', value)
84
+ },
79
85
  handleInit () {
80
86
  const $xeLoading = this
81
87
  const reactData = $xeLoading.reactData
@@ -88,6 +88,12 @@ export default defineVxeComponent({
88
88
  const $xeMenu = this
89
89
  $xeMenu.$emit(type, createEvent(evnt, { $menu: $xeMenu }, params))
90
90
  },
91
+ emitModel (value: any) {
92
+ const $xeMenu = this
93
+
94
+ $xeMenu.$emit('input', value)
95
+ $xeMenu.$emit('modelValue', value)
96
+ },
91
97
  getMenuTitle (item: VxeMenuPropTypes.MenuOption) {
92
98
  return `${item.title || item.name}`
93
99
  },
@@ -184,8 +190,7 @@ export default defineVxeComponent({
184
190
  if (routerLink) {
185
191
  const value = item.itemKey
186
192
  reactData.activeName = value
187
- $xeMenu.$emit('input', value)
188
- $xeMenu.$emit('modelValue', value)
193
+ $xeMenu.emitModel(value)
189
194
  } else {
190
195
  if (hasChild) {
191
196
  $xeMenu.handleClickIconCollapse(evnt, item)
@@ -263,6 +263,12 @@ export default defineVxeComponent({
263
263
  const $xeModal = this
264
264
  $xeModal.$emit(type, createEvent(evnt, { $modal: $xeModal }, params))
265
265
  },
266
+ emitModel (value: any) {
267
+ const $xeModal = this
268
+
269
+ $xeModal.$emit('input', value)
270
+ $xeModal.$emit('modelValue', value)
271
+ },
266
272
  open () {
267
273
  const $xeModal = this
268
274
 
@@ -454,8 +460,7 @@ export default defineVxeComponent({
454
460
  $xeModal.dispatchEvent('before-hide', params, null)
455
461
  setTimeout(() => {
456
462
  reactData.visible = false
457
- $xeModal.$emit('input', false)
458
- $xeModal.$emit('modelValue', false)
463
+ $xeModal.emitModel(false)
459
464
  $xeModal.dispatchEvent('hide', params, null)
460
465
  }, 200)
461
466
  $xeModal.removeBodyLockScroll()
@@ -780,8 +785,7 @@ export default defineVxeComponent({
780
785
  }
781
786
  const type = ''
782
787
  const params = { type }
783
- $xeModal.$emit('input', true)
784
- $xeModal.$emit('modelValue', true)
788
+ $xeModal.emitModel(true)
785
789
  $xeModal.dispatchEvent('show', params, null)
786
790
  })
787
791
  }, 10)
@@ -265,6 +265,11 @@ export default defineVxeComponent({
265
265
  const $xeNumberInput = this
266
266
  $xeNumberInput.$emit(type, createEvent(evnt, { $numberInput: $xeNumberInput }, params))
267
267
  },
268
+ emitModel (value: any) {
269
+ const $xeModal = this
270
+
271
+ $xeModal.$emit('modelValue', value)
272
+ },
268
273
  focus () {
269
274
  const $xeNumberInput = this
270
275
  const reactData = $xeNumberInput.reactData
@@ -312,7 +317,7 @@ export default defineVxeComponent({
312
317
  const { inputValue } = reactData
313
318
  $xeNumberInput.dispatchEvent(evnt.type, { value: inputValue }, evnt)
314
319
  },
315
- emitModel (val: number | null, inputValue: string, evnt: Event | { type: string }) {
320
+ handleChange (val: number | null, inputValue: string, evnt: Event | { type: string }) {
316
321
  const $xeNumberInput = this
317
322
  const props = $xeNumberInput
318
323
  const reactData = $xeNumberInput.reactData
@@ -323,7 +328,7 @@ export default defineVxeComponent({
323
328
  const isChange = value !== props.value
324
329
  if (isChange) {
325
330
  reactData.inputValue = inputValue || ''
326
- $xeNumberInput.$emit('modelValue', value)
331
+ $xeNumberInput.emitModel(value)
327
332
  }
328
333
  $xeNumberInput.dispatchEvent('input', { value }, evnt as Event)
329
334
  if (isChange) {
@@ -342,7 +347,7 @@ export default defineVxeComponent({
342
347
  const value = inputValue ? XEUtils.toNumber(inputValue) : null
343
348
  reactData.inputValue = inputValue
344
349
  if (inpImmediate) {
345
- $xeNumberInput.emitModel(value, inputValue, evnt)
350
+ $xeNumberInput.handleChange(value, inputValue, evnt)
346
351
  } else {
347
352
  $xeNumberInput.dispatchEvent('input', { value }, evnt)
348
353
  }
@@ -383,7 +388,7 @@ export default defineVxeComponent({
383
388
  const $xeNumberInput = this
384
389
 
385
390
  $xeNumberInput.focus()
386
- $xeNumberInput.emitModel(null, '', evnt)
391
+ $xeNumberInput.handleChange(null, '', evnt)
387
392
  $xeNumberInput.dispatchEvent('clear', { value }, evnt)
388
393
  },
389
394
  clickSuffixEvent (evnt: Event) {
@@ -416,7 +421,7 @@ export default defineVxeComponent({
416
421
  validValue = Number(textValue)
417
422
  }
418
423
  if (inputValue !== validValue) {
419
- $xeNumberInput.emitModel(validValue, textValue, { type: 'init' })
424
+ $xeNumberInput.handleChange(validValue, textValue, { type: 'init' })
420
425
  }
421
426
  }
422
427
  }
@@ -456,7 +461,7 @@ export default defineVxeComponent({
456
461
  }
457
462
  }
458
463
  const inpValue = $xeNumberInput.getNumberValue(inpNumVal)
459
- $xeNumberInput.emitModel(inpValue === null ? null : Number(inpValue), inpValue, { type: 'check' })
464
+ $xeNumberInput.handleChange(inpValue === null ? null : Number(inpValue), inpValue, { type: 'check' })
460
465
  }
461
466
  }
462
467
  },
@@ -468,7 +473,7 @@ export default defineVxeComponent({
468
473
  const inpImmediate = $xeNumberInput.computeInpImmediate
469
474
  const value = inputValue ? Number(inputValue) : null
470
475
  if (!inpImmediate) {
471
- $xeNumberInput.emitModel(value, `${inputValue || ''}`, evnt)
476
+ $xeNumberInput.handleChange(value, `${inputValue || ''}`, evnt)
472
477
  }
473
478
  $xeNumberInput.afterCheckValue()
474
479
  reactData.isActivated = false
@@ -109,6 +109,11 @@ export default defineVxeComponent({
109
109
  const $xePasswordInput = this
110
110
  $xePasswordInput.$emit(type, createEvent(evnt, { $passwordInput: $xePasswordInput }, params))
111
111
  },
112
+ emitModel (value: any) {
113
+ const $xeModal = this
114
+
115
+ $xeModal.$emit('modelValue', value)
116
+ },
112
117
  focus () {
113
118
  const $xePasswordInput = this
114
119
  const reactData = $xePasswordInput.reactData
@@ -157,7 +162,7 @@ export default defineVxeComponent({
157
162
  const value = inputElem.value
158
163
  $xePasswordInput.emitInputEvent(value, evnt)
159
164
  },
160
- emitModel (value: string, evnt: Event | { type: string }) {
165
+ handleChange (value: string, evnt: Event | { type: string }) {
161
166
  const $xePasswordInput = this
162
167
  const props = $xePasswordInput
163
168
  const reactData = $xePasswordInput.reactData
@@ -165,7 +170,7 @@ export default defineVxeComponent({
165
170
  const formItemInfo = $xePasswordInput.formItemInfo
166
171
 
167
172
  reactData.inputValue = value
168
- $xePasswordInput.$emit('modelValue', value)
173
+ $xePasswordInput.emitModel(value)
169
174
  $xePasswordInput.dispatchEvent('input', { value }, evnt as any)
170
175
  if (XEUtils.toValueString(props.value) !== value) {
171
176
  $xePasswordInput.dispatchEvent('change', { value }, evnt as any)
@@ -223,7 +228,7 @@ export default defineVxeComponent({
223
228
  const $xePasswordInput = this
224
229
 
225
230
  $xePasswordInput.focus()
226
- $xePasswordInput.emitModel('', evnt)
231
+ $xePasswordInput.handleChange('', evnt)
227
232
  $xePasswordInput.dispatchEvent('clear', { value }, evnt)
228
233
  },
229
234
  clickSuffixEvent (evnt: Event) {
@@ -113,6 +113,11 @@ export default defineVxeComponent({
113
113
  const $xePulldown = this
114
114
  $xePulldown.$emit(type, createEvent(evnt, { $pulldown: $xePulldown }, params))
115
115
  },
116
+ emitModel (value: any) {
117
+ const $xePulldown = this
118
+
119
+ $xePulldown.$emit('modelValue', value)
120
+ },
116
121
  updateZindex () {
117
122
  const $xePulldown = this
118
123
  const reactData = $xePulldown.reactData
@@ -234,7 +239,7 @@ export default defineVxeComponent({
234
239
  reactData.visibleAnimate = true
235
240
  setTimeout(() => {
236
241
  reactData.visiblePanel = true
237
- $xePulldown.$emit('modelValue', true)
242
+ $xePulldown.emitModel(true)
238
243
  $xePulldown.updatePlacement()
239
244
  setTimeout(() => {
240
245
  resolve($xePulldown.updatePlacement())
@@ -257,7 +262,7 @@ export default defineVxeComponent({
257
262
  const internalData = $xePulldown.internalData
258
263
 
259
264
  reactData.visiblePanel = false
260
- $xePulldown.$emit('modelValue', false)
265
+ $xePulldown.emitModel(false)
261
266
  return new Promise<void>(resolve => {
262
267
  if (reactData.visibleAnimate) {
263
268
  internalData.hpTimeout = window.setTimeout(() => {
@@ -103,6 +103,12 @@ export default defineVxeComponent({
103
103
  const $xeRadioButton = this
104
104
  $xeRadioButton.$emit(type, createEvent(evnt, { $radioButton: $xeRadioButton }, params))
105
105
  },
106
+ emitModel (value: any) {
107
+ const $xeRadioButton = this
108
+
109
+ $xeRadioButton.$emit('input', value)
110
+ $xeRadioButton.$emit('modelValue', value)
111
+ },
106
112
  handleValue (label: VxeRadioButtonPropTypes.Label, evnt: Event) {
107
113
  const $xeRadioButton = this
108
114
  const $xeForm = $xeRadioButton.$xeForm
@@ -112,8 +118,7 @@ export default defineVxeComponent({
112
118
  if ($xeRadioGroup) {
113
119
  $xeRadioGroup.handleChecked({ label }, evnt)
114
120
  } else {
115
- $xeRadioButton.$emit('input', label)
116
- $xeRadioButton.$emit('modelValue', label)
121
+ $xeRadioButton.emitModel(label)
117
122
  $xeRadioButton.dispatchEvent('change', { label }, evnt)
118
123
  // 自动更新校验状态
119
124
  if ($xeForm && formItemInfo) {
@@ -110,6 +110,12 @@ export default defineVxeComponent({
110
110
 
111
111
  $xeRadioGroup.$emit(type, createEvent(evnt, { $radioGroup: $xeRadioGroup }, params))
112
112
  },
113
+ emitModel (value: any) {
114
+ const $xeRadioGroup = this
115
+
116
+ $xeRadioGroup.$emit('input', value)
117
+ $xeRadioGroup.$emit('modelValue', value)
118
+ },
113
119
  handleChecked (params: {
114
120
  label: any
115
121
  }, evnt: Event) {
@@ -118,8 +124,7 @@ export default defineVxeComponent({
118
124
  const formItemInfo = $xeRadioGroup.formItemInfo
119
125
 
120
126
  const value = params.label
121
- $xeRadioGroup.$emit('input', value)
122
- $xeRadioGroup.$emit('modelValue', value)
127
+ $xeRadioGroup.emitModel(value)
123
128
  $xeRadioGroup.dispatchEvent('change', params, evnt)
124
129
  // 自动更新校验状态
125
130
  if ($xeForm && formItemInfo) {
@@ -105,6 +105,12 @@ export default defineVxeComponent({
105
105
  const $xeRadio = this
106
106
  $xeRadio.$emit(type, createEvent(evnt, { $radio: $xeRadio }, params))
107
107
  },
108
+ emitModel (value: any) {
109
+ const $xeRadio = this
110
+
111
+ $xeRadio.$emit('input', value)
112
+ $xeRadio.$emit('modelValue', value)
113
+ },
108
114
  handleValue (label: VxeRadioPropTypes.Label, evnt: Event) {
109
115
  const $xeRadio = this
110
116
  const formItemInfo = $xeRadio.formItemInfo
@@ -114,8 +120,7 @@ export default defineVxeComponent({
114
120
  if ($xeRadioGroup) {
115
121
  $xeRadioGroup.handleChecked({ label }, evnt)
116
122
  } else {
117
- $xeRadio.$emit('input', label)
118
- $xeRadio.$emit('modelValue', label)
123
+ $xeRadio.emitModel(label)
119
124
  $xeRadio.dispatchEvent('change', { label }, evnt)
120
125
  // 自动更新校验状态
121
126
  if ($xeForm && formItemInfo) {