vxe-table 4.23.7 → 4.23.9

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 (148) hide show
  1. package/dist/all.esm.js +5859 -4018
  2. package/es/colgroup/index.js +1 -1
  3. package/es/column/index.js +1 -1
  4. package/es/components.d.ts +3 -0
  5. package/es/components.js +4 -8
  6. package/es/grid/index.js +1 -1
  7. package/es/grid/src/emits.js +1 -15
  8. package/es/grid/src/grid.js +398 -121
  9. package/es/grid/src/props.js +1 -1
  10. package/es/index.esm.js +6 -0
  11. package/es/index.js +6 -0
  12. package/es/table/index.js +1 -1
  13. package/es/table/module/custom/hook.js +50 -43
  14. package/es/table/module/custom/panel.js +778 -528
  15. package/es/table/module/edit/hook.js +141 -63
  16. package/es/table/module/export/export-panel.js +400 -317
  17. package/es/table/module/export/hook.js +396 -338
  18. package/es/table/module/export/import-panel.js +153 -124
  19. package/es/table/module/filter/hook.js +17 -3
  20. package/es/table/module/filter/panel.js +147 -85
  21. package/es/table/module/keyboard/hook.js +9 -5
  22. package/es/table/module/menu/hook.js +1 -1
  23. package/es/table/module/menu/panel.js +198 -127
  24. package/es/table/module/validator/hook.js +1 -1
  25. package/es/table/render/index.js +152 -99
  26. package/es/table/src/body.js +356 -234
  27. package/es/table/src/cell.js +427 -270
  28. package/es/table/src/columnInfo.js +2 -1
  29. package/es/table/src/footer.js +145 -100
  30. package/es/table/src/group.js +7 -3
  31. package/es/table/src/header.js +230 -173
  32. package/es/table/src/props.js +1 -1
  33. package/es/table/src/table.js +1504 -1031
  34. package/es/table/src/util.js +15 -19
  35. package/es/toolbar/index.js +1 -1
  36. package/es/toolbar/src/toolbar.js +133 -76
  37. package/es/ui/index.d.ts +0 -1
  38. package/es/ui/index.js +1 -2
  39. package/es/ui/src/dom.js +9 -6
  40. package/es/ui/src/log.js +1 -1
  41. package/es/ui/src/utils.d.ts +1 -1
  42. package/es/v-x-e-table/index.d.ts +0 -1
  43. package/es/v-x-e-table/index.js +0 -1
  44. package/lib/colgroup/index.js +5 -5
  45. package/lib/column/index.js +5 -5
  46. package/lib/components.js +8 -12
  47. package/lib/grid/index.js +4 -4
  48. package/lib/grid/src/emits.js +1 -15
  49. package/lib/grid/src/grid.js +419 -142
  50. package/lib/grid/src/props.js +2 -2
  51. package/lib/index.common.js +6 -0
  52. package/lib/index.js +6 -0
  53. package/lib/index.umd.js +5825 -3945
  54. package/lib/index.umd.min.js +3 -3
  55. package/lib/table/index.js +5 -5
  56. package/lib/table/module/custom/hook.js +51 -44
  57. package/lib/table/module/custom/panel.js +790 -540
  58. package/lib/table/module/edit/hook.js +142 -64
  59. package/lib/table/module/export/export-panel.js +406 -323
  60. package/lib/table/module/export/hook.js +419 -361
  61. package/lib/table/module/export/import-panel.js +157 -128
  62. package/lib/table/module/filter/hook.js +18 -4
  63. package/lib/table/module/filter/panel.js +149 -87
  64. package/lib/table/module/keyboard/hook.js +10 -6
  65. package/lib/table/module/menu/hook.js +2 -2
  66. package/lib/table/module/menu/panel.js +199 -128
  67. package/lib/table/module/validator/hook.js +2 -2
  68. package/lib/table/render/index.js +153 -100
  69. package/lib/table/src/body.js +357 -235
  70. package/lib/table/src/cell.js +428 -271
  71. package/lib/table/src/columnInfo.js +3 -2
  72. package/lib/table/src/footer.js +146 -101
  73. package/lib/table/src/group.js +7 -3
  74. package/lib/table/src/header.js +231 -174
  75. package/lib/table/src/props.js +2 -2
  76. package/lib/table/src/table.js +1487 -1045
  77. package/lib/table/src/util.js +15 -19
  78. package/lib/toolbar/index.js +4 -4
  79. package/lib/toolbar/src/toolbar.js +135 -78
  80. package/lib/ui/index.js +1 -3
  81. package/lib/ui/src/dom.js +9 -6
  82. package/lib/ui/src/log.js +1 -1
  83. package/lib/v-x-e-table/index.js +0 -2
  84. package/package.json +8 -3
  85. package/packages/colgroup/index.ts +22 -22
  86. package/packages/column/index.ts +22 -22
  87. package/packages/components.ts +41 -43
  88. package/packages/grid/index.ts +18 -18
  89. package/packages/grid/src/emits.ts +5 -19
  90. package/packages/grid/src/grid.ts +2229 -1925
  91. package/packages/grid/src/props.ts +22 -23
  92. package/packages/index.ts +11 -4
  93. package/packages/locale/lang/fr-FR.ts +15 -15
  94. package/packages/locale/lang/it-IT.ts +4 -4
  95. package/packages/locale/lang/uk-UA.ts +1 -1
  96. package/packages/locale/lang/uz-UZ.ts +13 -13
  97. package/packages/locale/lang/zh-CN.ts +907 -907
  98. package/packages/table/index.ts +26 -26
  99. package/packages/table/module/custom/hook.ts +510 -503
  100. package/packages/table/module/custom/panel.ts +2002 -1743
  101. package/packages/table/module/edit/hook.ts +1224 -1131
  102. package/packages/table/module/export/export-panel.ts +697 -611
  103. package/packages/table/module/export/hook.ts +2160 -2059
  104. package/packages/table/module/export/import-panel.ts +319 -279
  105. package/packages/table/module/export/util.ts +25 -24
  106. package/packages/table/module/filter/hook.ts +519 -501
  107. package/packages/table/module/filter/panel.ts +368 -304
  108. package/packages/table/module/keyboard/hook.ts +498 -494
  109. package/packages/table/module/menu/hook.ts +330 -330
  110. package/packages/table/module/menu/panel.ts +272 -201
  111. package/packages/table/module/validator/hook.ts +653 -635
  112. package/packages/table/render/index.ts +1819 -1744
  113. package/packages/table/src/body.ts +1078 -955
  114. package/packages/table/src/cell.ts +1524 -1359
  115. package/packages/table/src/column.ts +192 -192
  116. package/packages/table/src/columnInfo.ts +232 -232
  117. package/packages/table/src/emits.ts +134 -134
  118. package/packages/table/src/footer.ts +425 -380
  119. package/packages/table/src/group.ts +67 -63
  120. package/packages/table/src/header.ts +642 -581
  121. package/packages/table/src/props.ts +336 -336
  122. package/packages/table/src/store.ts +14 -14
  123. package/packages/table/src/table.ts +16011 -15454
  124. package/packages/table/src/use/cell-view.ts +41 -44
  125. package/packages/table/src/use/index.ts +1 -1
  126. package/packages/table/src/util.ts +1206 -1216
  127. package/packages/toolbar/index.ts +18 -18
  128. package/packages/toolbar/src/toolbar.ts +768 -706
  129. package/packages/ui/index.ts +519 -521
  130. package/packages/ui/src/anime.ts +51 -52
  131. package/packages/ui/src/comp.ts +3 -3
  132. package/packages/ui/src/dom.ts +466 -463
  133. package/packages/ui/src/log.ts +19 -19
  134. package/packages/ui/src/utils.ts +66 -66
  135. package/packages/ui/src/vn.ts +55 -55
  136. package/packages/v-x-e-table/index.d.ts +3 -4
  137. package/packages/v-x-e-table/index.ts +3 -4
  138. package/types/all.d.ts +76 -76
  139. package/types/index.d.ts +4 -4
  140. /package/dist/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  141. /package/dist/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  142. /package/dist/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  143. /package/es/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  144. /package/es/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  145. /package/es/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
  146. /package/lib/{iconfont.1792979665397.ttf → iconfont.1793009263429.ttf} +0 -0
  147. /package/lib/{iconfont.1792979665397.woff → iconfont.1793009263429.woff} +0 -0
  148. /package/lib/{iconfont.1792979665397.woff2 → iconfont.1793009263429.woff2} +0 -0
@@ -1,192 +1,192 @@
1
- import { h, onUnmounted, inject, ref, PropType, provide, onMounted, createCommentVNode } from 'vue'
2
- import { defineVxeComponent } from '../../ui/src/comp'
3
- import { XEColumnInstance, watchColumn, assembleColumn, destroyColumn } from './util'
4
- import Cell from './cell'
5
-
6
- import type { VxeTableConstructor, VxeTablePrivateMethods, VxeColumnPropTypes, VxeColumnProps } from '../../../types'
7
-
8
- export const columnProps = {
9
- // 列唯一主键
10
- colId: [String, Number] as PropType<VxeColumnPropTypes.ColId>,
11
- // 渲染类型 index,radio,checkbox,expand,html
12
- type: String as PropType<VxeColumnPropTypes.Type>,
13
- // 列字段名
14
- field: String as PropType<VxeColumnPropTypes.Field>,
15
- // 列标题
16
- title: String as PropType<VxeColumnPropTypes.Title>,
17
- // 列宽度
18
- width: [Number, String] as PropType<VxeColumnPropTypes.Width>,
19
- // 列最小宽度,把剩余宽度按比例分配
20
- minWidth: [Number, String] as PropType<VxeColumnPropTypes.MinWidth>,
21
- // 列最大宽度
22
- maxWidth: [Number, String] as PropType<VxeColumnPropTypes.MaxWidth>,
23
- // 是否允许拖动列宽调整大小
24
- resizable: {
25
- type: Boolean as PropType<VxeColumnPropTypes.Resizable>,
26
- default: null
27
- },
28
- // 将列固定在左侧或者右侧
29
- fixed: String as PropType<VxeColumnPropTypes.Fixed>,
30
- // 列对其方式
31
- align: String as PropType<VxeColumnPropTypes.Align>,
32
- // 表头对齐方式
33
- headerAlign: String as PropType<VxeColumnPropTypes.HeaderAlign>,
34
- // 表尾列的对齐方式
35
- footerAlign: String as PropType<VxeColumnPropTypes.FooterAlign>,
36
- // 当内容过长时显示为省略号
37
- showOverflow: {
38
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowOverflow>,
39
- default: null
40
- },
41
- // 当表头内容过长时显示为省略号
42
- showHeaderOverflow: {
43
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowHeaderOverflow>,
44
- default: null
45
- },
46
- // 当表尾内容过长时显示为省略号
47
- showFooterOverflow: {
48
- type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowFooterOverflow>,
49
- default: null
50
- },
51
- // 给单元格附加 className
52
- className: [String, Function] as PropType<VxeColumnPropTypes.ClassName>,
53
- // 给表头单元格附加 className
54
- headerClassName: [String, Function] as PropType<VxeColumnPropTypes.HeaderClassName>,
55
- // 给表尾单元格附加 className
56
- footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
57
- // 格式化显示内容
58
- formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
59
- // 格式化表头显示内容
60
- headerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.HeaderFormatter>,
61
- // 格式化表尾显示内容
62
- footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
63
- // 是否显示间距
64
- padding: {
65
- type: Boolean as PropType<VxeColumnPropTypes.Padding>,
66
- default: null
67
- },
68
- // 垂直对齐方式
69
- verticalAlign: {
70
- type: String as PropType<VxeColumnPropTypes.VerticalAlign>,
71
- default: null
72
- },
73
- // 是否允许排序
74
- sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
75
- // 自定义排序的属性
76
- sortBy: [String, Function] as PropType<VxeColumnPropTypes.SortBy>,
77
- // 排序的字段类型,比如字符串转数值等
78
- sortType: String as PropType<VxeColumnPropTypes.SortType>,
79
- // 配置筛选条件数组
80
- filters: {
81
- type: Array as PropType<VxeColumnPropTypes.Filters>,
82
- default: null
83
- },
84
- // 筛选是否允许多选
85
- filterMultiple: {
86
- type: Boolean as PropType<VxeColumnPropTypes.FilterMultiple>,
87
- default: true
88
- },
89
- // 自定义筛选方法
90
- filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod<any>>,
91
- // 筛选重置方法
92
- filterResetMethod: Function as PropType<VxeColumnPropTypes.FilterResetMethod>,
93
- // 筛选复原方法
94
- filterRecoverMethod: Function as PropType<VxeColumnPropTypes.FilterRecoverMethod>,
95
- // 筛选模板配置项
96
- filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
97
- // 是否显示浮动筛选
98
- floatingFilters: Object as PropType<VxeColumnPropTypes.FloatingFilters>,
99
- // 列的校验规则
100
- rules: Array as PropType<VxeColumnPropTypes.Rules>,
101
- // 设置为分组节点
102
- rowGroupNode: Boolean as PropType<VxeColumnPropTypes.RowGroupNode>,
103
- // 设置为树节点
104
- treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
105
- // 设置为拖拽排序
106
- dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
107
- // 设置为行高拖拽
108
- rowResize: Boolean as PropType<VxeColumnPropTypes.RowResize>,
109
- // 是否可视
110
- visible: {
111
- type: Boolean as PropType<VxeColumnPropTypes.Visible>,
112
- default: null
113
- },
114
- // 表头单元格数据导出方法
115
- headerExportMethod: Function as PropType<VxeColumnPropTypes.HeaderExportMethod>,
116
- // 单元格数据导出方法
117
- exportMethod: Function as PropType<VxeColumnPropTypes.ExportMethod>,
118
- // 表尾单元格数据导出方法
119
- footerExportMethod: Function as PropType<VxeColumnPropTypes.FooterExportMethod>,
120
- // 已废弃,被 titlePrefix 替换
121
- titleHelp: Object as PropType<VxeColumnPropTypes.TitleHelp>,
122
- // 标题前缀图标配置项
123
- titlePrefix: Object as PropType<VxeColumnPropTypes.TitlePrefix>,
124
- // 标题后缀图标配置项
125
- titleSuffix: Object as PropType<VxeColumnPropTypes.TitleSuffix>,
126
- // 单元格值类型
127
- cellType: String as PropType<VxeColumnPropTypes.CellType>,
128
- // 单元格渲染配置项
129
- cellRender: Object as PropType<VxeColumnPropTypes.CellRender<any>>,
130
- // 单元格编辑渲染配置项
131
- editRender: Object as PropType<VxeColumnPropTypes.EditRender>,
132
- // 内容渲染配置项
133
- contentRender: Object as PropType<VxeColumnPropTypes.ContentRender>,
134
-
135
- // 聚合函数
136
- aggFunc: [Boolean, String] as PropType<VxeColumnPropTypes.AggFunc>,
137
- // 将单元格复制到剪贴板
138
- copyMethod: Function as PropType<VxeColumnPropTypes.CopyMethod>,
139
- // 将剪贴单元格的值清除
140
- cutMethod: Function as PropType<VxeColumnPropTypes.CutMethod>,
141
- // 从剪贴板赋值到单元格
142
- pasteMethod: Function as PropType<VxeColumnPropTypes.PasteMethod>,
143
-
144
- // 额外的参数
145
- params: Object as PropType<VxeColumnPropTypes.Params>
146
- }
147
-
148
- export default defineVxeComponent({
149
- name: 'VxeColumn',
150
- props: columnProps,
151
- setup (props, { slots }) {
152
- const refElem = ref<HTMLDivElement>()
153
- const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
154
- const $xeColgroup = inject<XEColumnInstance | null>('$xeColgroup', null)
155
- if (!$xeTable) {
156
- return () => createCommentVNode()
157
- }
158
- const columnConfig = Cell.createColumn($xeTable, props as VxeColumnProps)
159
- columnConfig.slots = slots
160
-
161
- const renderVN = () => {
162
- return h('div', {
163
- ref: refElem
164
- })
165
- }
166
-
167
- const $xeColumn = {
168
- columnConfig,
169
-
170
- renderVN
171
- } as XEColumnInstance
172
-
173
- watchColumn($xeTable, props, columnConfig)
174
-
175
- onMounted(() => {
176
- const elem = refElem.value
177
- if (elem) {
178
- assembleColumn($xeTable, elem, columnConfig, $xeColgroup)
179
- }
180
- })
181
-
182
- onUnmounted(() => {
183
- destroyColumn($xeTable, columnConfig)
184
- })
185
-
186
- provide('$xeColumn', $xeColumn)
187
- provide('$xeGrid', null)
188
- provide('$xeGantt', null)
189
-
190
- return renderVN
191
- }
192
- })
1
+ import { h, onUnmounted, inject, ref, PropType, provide, onMounted, createCommentVNode } from 'vue'
2
+ import { defineVxeComponent } from '../../ui/src/comp'
3
+ import { XEColumnInstance, watchColumn, assembleColumn, destroyColumn } from './util'
4
+ import Cell from './cell'
5
+
6
+ import type { VxeTableConstructor, VxeTablePrivateMethods, VxeColumnPropTypes, VxeColumnProps } from '../../../types'
7
+
8
+ export const columnProps = {
9
+ // 列唯一主键
10
+ colId: [String, Number] as PropType<VxeColumnPropTypes.ColId>,
11
+ // 渲染类型 index,radio,checkbox,expand,html
12
+ type: String as PropType<VxeColumnPropTypes.Type>,
13
+ // 列字段名
14
+ field: String as PropType<VxeColumnPropTypes.Field>,
15
+ // 列标题
16
+ title: String as PropType<VxeColumnPropTypes.Title>,
17
+ // 列宽度
18
+ width: [Number, String] as PropType<VxeColumnPropTypes.Width>,
19
+ // 列最小宽度,把剩余宽度按比例分配
20
+ minWidth: [Number, String] as PropType<VxeColumnPropTypes.MinWidth>,
21
+ // 列最大宽度
22
+ maxWidth: [Number, String] as PropType<VxeColumnPropTypes.MaxWidth>,
23
+ // 是否允许拖动列宽调整大小
24
+ resizable: {
25
+ type: Boolean as PropType<VxeColumnPropTypes.Resizable>,
26
+ default: null
27
+ },
28
+ // 将列固定在左侧或者右侧
29
+ fixed: String as PropType<VxeColumnPropTypes.Fixed>,
30
+ // 列对其方式
31
+ align: String as PropType<VxeColumnPropTypes.Align>,
32
+ // 表头对齐方式
33
+ headerAlign: String as PropType<VxeColumnPropTypes.HeaderAlign>,
34
+ // 表尾列的对齐方式
35
+ footerAlign: String as PropType<VxeColumnPropTypes.FooterAlign>,
36
+ // 当内容过长时显示为省略号
37
+ showOverflow: {
38
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowOverflow>,
39
+ default: null
40
+ },
41
+ // 当表头内容过长时显示为省略号
42
+ showHeaderOverflow: {
43
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowHeaderOverflow>,
44
+ default: null
45
+ },
46
+ // 当表尾内容过长时显示为省略号
47
+ showFooterOverflow: {
48
+ type: [Boolean, String] as PropType<VxeColumnPropTypes.ShowFooterOverflow>,
49
+ default: null
50
+ },
51
+ // 给单元格附加 className
52
+ className: [String, Function] as PropType<VxeColumnPropTypes.ClassName>,
53
+ // 给表头单元格附加 className
54
+ headerClassName: [String, Function] as PropType<VxeColumnPropTypes.HeaderClassName>,
55
+ // 给表尾单元格附加 className
56
+ footerClassName: [String, Function] as PropType<VxeColumnPropTypes.FooterClassName>,
57
+ // 格式化显示内容
58
+ formatter: [Function, Array, String] as PropType<VxeColumnPropTypes.Formatter<any>>,
59
+ // 格式化表头显示内容
60
+ headerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.HeaderFormatter>,
61
+ // 格式化表尾显示内容
62
+ footerFormatter: [Function, Array, String] as PropType<VxeColumnPropTypes.FooterFormatter>,
63
+ // 是否显示间距
64
+ padding: {
65
+ type: Boolean as PropType<VxeColumnPropTypes.Padding>,
66
+ default: null
67
+ },
68
+ // 垂直对齐方式
69
+ verticalAlign: {
70
+ type: String as PropType<VxeColumnPropTypes.VerticalAlign>,
71
+ default: null
72
+ },
73
+ // 是否允许排序
74
+ sortable: Boolean as PropType<VxeColumnPropTypes.Sortable>,
75
+ // 自定义排序的属性
76
+ sortBy: [String, Function] as PropType<VxeColumnPropTypes.SortBy>,
77
+ // 排序的字段类型,比如字符串转数值等
78
+ sortType: String as PropType<VxeColumnPropTypes.SortType>,
79
+ // 配置筛选条件数组
80
+ filters: {
81
+ type: Array as PropType<VxeColumnPropTypes.Filters>,
82
+ default: null
83
+ },
84
+ // 筛选是否允许多选
85
+ filterMultiple: {
86
+ type: Boolean as PropType<VxeColumnPropTypes.FilterMultiple>,
87
+ default: true
88
+ },
89
+ // 自定义筛选方法
90
+ filterMethod: Function as PropType<VxeColumnPropTypes.FilterMethod<any>>,
91
+ // 筛选重置方法
92
+ filterResetMethod: Function as PropType<VxeColumnPropTypes.FilterResetMethod>,
93
+ // 筛选复原方法
94
+ filterRecoverMethod: Function as PropType<VxeColumnPropTypes.FilterRecoverMethod>,
95
+ // 筛选模板配置项
96
+ filterRender: Object as PropType<VxeColumnPropTypes.FilterRender>,
97
+ // 是否显示浮动筛选
98
+ floatingFilters: Object as PropType<VxeColumnPropTypes.FloatingFilters>,
99
+ // 列的校验规则
100
+ rules: Array as PropType<VxeColumnPropTypes.Rules>,
101
+ // 设置为分组节点
102
+ rowGroupNode: Boolean as PropType<VxeColumnPropTypes.RowGroupNode>,
103
+ // 设置为树节点
104
+ treeNode: Boolean as PropType<VxeColumnPropTypes.TreeNode>,
105
+ // 设置为拖拽排序
106
+ dragSort: Boolean as PropType<VxeColumnPropTypes.DragSort>,
107
+ // 设置为行高拖拽
108
+ rowResize: Boolean as PropType<VxeColumnPropTypes.RowResize>,
109
+ // 是否可视
110
+ visible: {
111
+ type: Boolean as PropType<VxeColumnPropTypes.Visible>,
112
+ default: null
113
+ },
114
+ // 表头单元格数据导出方法
115
+ headerExportMethod: Function as PropType<VxeColumnPropTypes.HeaderExportMethod>,
116
+ // 单元格数据导出方法
117
+ exportMethod: Function as PropType<VxeColumnPropTypes.ExportMethod>,
118
+ // 表尾单元格数据导出方法
119
+ footerExportMethod: Function as PropType<VxeColumnPropTypes.FooterExportMethod>,
120
+ // 已废弃,被 titlePrefix 替换
121
+ titleHelp: Object as PropType<VxeColumnPropTypes.TitleHelp>,
122
+ // 标题前缀图标配置项
123
+ titlePrefix: Object as PropType<VxeColumnPropTypes.TitlePrefix>,
124
+ // 标题后缀图标配置项
125
+ titleSuffix: Object as PropType<VxeColumnPropTypes.TitleSuffix>,
126
+ // 单元格值类型
127
+ cellType: String as PropType<VxeColumnPropTypes.CellType>,
128
+ // 单元格渲染配置项
129
+ cellRender: Object as PropType<VxeColumnPropTypes.CellRender<any>>,
130
+ // 单元格编辑渲染配置项
131
+ editRender: Object as PropType<VxeColumnPropTypes.EditRender>,
132
+ // 内容渲染配置项
133
+ contentRender: Object as PropType<VxeColumnPropTypes.ContentRender>,
134
+
135
+ // 聚合函数
136
+ aggFunc: [Boolean, String] as PropType<VxeColumnPropTypes.AggFunc>,
137
+ // 将单元格复制到剪贴板
138
+ copyMethod: Function as PropType<VxeColumnPropTypes.CopyMethod>,
139
+ // 将剪贴单元格的值清除
140
+ cutMethod: Function as PropType<VxeColumnPropTypes.CutMethod>,
141
+ // 从剪贴板赋值到单元格
142
+ pasteMethod: Function as PropType<VxeColumnPropTypes.PasteMethod>,
143
+
144
+ // 额外的参数
145
+ params: Object as PropType<VxeColumnPropTypes.Params>
146
+ }
147
+
148
+ export default defineVxeComponent({
149
+ name: 'VxeColumn',
150
+ props: columnProps,
151
+ setup(props, { slots }) {
152
+ const refElem = ref<HTMLDivElement>()
153
+ const $xeTable = inject<(VxeTableConstructor & VxeTablePrivateMethods) | null>('$xeTable', null)
154
+ const $xeColgroup = inject<XEColumnInstance | null>('$xeColgroup', null)
155
+ if (!$xeTable) {
156
+ return () => createCommentVNode()
157
+ }
158
+ const columnConfig = Cell.createColumn($xeTable, props as VxeColumnProps)
159
+ columnConfig.slots = slots
160
+
161
+ const renderVN = () => {
162
+ return h('div', {
163
+ ref: refElem
164
+ })
165
+ }
166
+
167
+ const $xeColumn = {
168
+ columnConfig,
169
+
170
+ renderVN
171
+ } as XEColumnInstance
172
+
173
+ watchColumn($xeTable, props, columnConfig)
174
+
175
+ onMounted(() => {
176
+ const elem = refElem.value
177
+ if (elem) {
178
+ assembleColumn($xeTable, elem, columnConfig, $xeColgroup)
179
+ }
180
+ })
181
+
182
+ onUnmounted(() => {
183
+ destroyColumn($xeTable, columnConfig)
184
+ })
185
+
186
+ provide('$xeColumn', $xeColumn)
187
+ provide('$xeGrid', null)
188
+ provide('$xeGantt', null)
189
+
190
+ return renderVN
191
+ }
192
+ })