@elementplus-kit/uikit 1.6.0 → 1.7.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 (65) hide show
  1. package/build.log +0 -0
  2. package/components/button/index.ts +4 -0
  3. package/components/button/src/constants.ts +50 -0
  4. package/components/button/src/index.ts +264 -0
  5. package/components/button/style/index.scss +3 -0
  6. package/components/config.ts +4 -0
  7. package/components/dialog/index.ts +6 -0
  8. package/components/dialog/src/constants.ts +3 -0
  9. package/components/dialog/src/index.ts +54 -0
  10. package/components/dialog/style/index.scss +18 -0
  11. package/components/dictLabel/index.ts +4 -0
  12. package/components/dictLabel/src/index.vue +21 -0
  13. package/components/drawer/index.ts +4 -0
  14. package/components/drawer/src/constants.ts +3 -0
  15. package/components/drawer/src/index.ts +53 -0
  16. package/components/drawer/style/index.scss +18 -0
  17. package/components/form/index.ts +4 -0
  18. package/components/form/src/FormItem.ts +398 -0
  19. package/components/form/src/constants.ts +161 -0
  20. package/components/form/src/index.ts +198 -0
  21. package/components/form/src/types.ts +39 -0
  22. package/components/form/src/utils.ts +4 -0
  23. package/components/form/style/index.scss +5 -0
  24. package/components/pagination/index.ts +4 -0
  25. package/components/pagination/src/constants.ts +5 -0
  26. package/components/pagination/src/index.ts +50 -0
  27. package/components/search/index.ts +4 -0
  28. package/components/search/src/index.tsx +294 -0
  29. package/components/search/style/index.scss +104 -0
  30. package/components/table/index.ts +4 -0
  31. package/components/table/src/TableColumn.ts +116 -0
  32. package/components/table/src/constants.ts +42 -0
  33. package/components/table/src/index.ts +250 -0
  34. package/components/table/src/index2.ts +219 -0
  35. package/components/table/src/index3.ts +233 -0
  36. package/components/table/src/tableDictLabel.vue +21 -0
  37. package/components/table/src/tableaa.ts +71 -0
  38. package/components/table/src/type.ts +0 -0
  39. package/components/table/type/index.scss +0 -0
  40. package/components/table2/index.ts +4 -0
  41. package/components/table2/src/config.ts +5 -0
  42. package/components/table2/src/index.ts +12 -0
  43. package/components/table2/src/render.ts +136 -0
  44. package/components/table2/src/types.ts +39 -0
  45. package/components/table2/style/index.scss +0 -0
  46. package/components//346/250/241/346/235/277/index.tsx +57 -0
  47. package/components//346/250/241/346/235/277/ttt.ts +66 -0
  48. package/components//346/250/241/346/235/277/ttt.vue +18 -0
  49. package/index.ts +2 -0
  50. package/package.json +1 -4
  51. package/vite.config.ts +30 -0
  52. package//345/205/266/344/273/226/core/dialog/elementPlus/dialogWarp.vue +151 -0
  53. package//345/205/266/344/273/226/core/dialog/index.ts +10 -0
  54. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.ts +15 -0
  55. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.vue +16 -0
  56. package//345/205/266/344/273/226/core/form/elementPlus/formRender.ts +55 -0
  57. package//345/205/266/344/273/226/core/form/index.ts +10 -0
  58. package//345/205/266/344/273/226/core/table/config.ts +5 -0
  59. package//345/205/266/344/273/226/core/table/render.ts +91 -0
  60. package//345/205/266/344/273/226/core/table/warp.ts +11 -0
  61. package//345/205/266/344/273/226/core/utils/fetch.ts +58 -0
  62. package//345/205/266/344/273/226/useMessage.ts +95 -0
  63. package/dist/index.css +0 -1
  64. package/dist/index.mjs +0 -1079
  65. package/dist/index.umd.js +0 -1
@@ -0,0 +1,219 @@
1
+ import {
2
+ defineComponent,
3
+ h,
4
+ getCurrentInstance,
5
+ computed,
6
+ type ExtractPropTypes,
7
+ } from "vue";
8
+ import { ElTable, ElTableColumn } from "element-plus";
9
+ import {
10
+ defaultAttrs,
11
+ tableSlots,
12
+ tablecolumnSlots,
13
+ selectionColumn,
14
+ indexColumn,
15
+ } from "./constants.ts";
16
+ import { isArray, isObject } from "lodash-es";
17
+ const propsAttrs = {
18
+ module: {
19
+ // 公共参数用于业务判断
20
+ type: Object,
21
+ default: () => {},
22
+ },
23
+ // isRadio: { // 是否为单选框
24
+ // type: Boolean,
25
+ // default: false,
26
+ // },
27
+ // isCheckbox: { // 是否为复选框
28
+ // type: Boolean,
29
+ // default: false,
30
+ // },
31
+ columns: {
32
+ // 列数据
33
+ type: Array,
34
+ default: () => [],
35
+ },
36
+ showSelection: {
37
+ // 是否显示选择列
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ showIndex: {
42
+ // 是否显示索引列
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ };
47
+
48
+ export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
49
+
50
+ export default defineComponent({
51
+ props: propsAttrs,
52
+ // emits: eventList,
53
+
54
+ // attrs, emit会继承, slots需要设置
55
+ setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
56
+ // 暴露elTable组件上的方法
57
+ const vm = getCurrentInstance(); // 获取虚拟DOM实例
58
+ const cTableFnRef = (el) => {
59
+ if (!el) return;
60
+ vm.exposed = el; // 设置暴露对象
61
+ vm.exposeProxy = el; // 设置代理暴露对象
62
+ };
63
+
64
+ // 暴露方法
65
+ expose({
66
+ // tableRef,
67
+ });
68
+
69
+ // 属性处理
70
+ const getAttrs = () => {
71
+ const obj = {
72
+ ...defaultAttrs, // 设置默认值
73
+ };
74
+ return obj;
75
+ };
76
+ // 事件处理
77
+ const getEvents = () => {
78
+ const obj = {
79
+ ...defaultAttrs, // 设置默认值
80
+ };
81
+ return obj;
82
+ };
83
+
84
+ const columnsList = computed(() => {
85
+ let list = [];
86
+ list = getArrayColumn();
87
+ // 处理多选与序号列
88
+ if (props.showSelection) {
89
+ list.push(
90
+ h(ElTableColumn, {
91
+ type: "selection",
92
+ width: 55,
93
+ })
94
+ );
95
+ }
96
+ if (props.showIndex) {
97
+ list.push(
98
+ h(ElTableColumn, {
99
+ label: "序号",
100
+ type: "index",
101
+ width: 55,
102
+ })
103
+ );
104
+ }
105
+ return list;
106
+ });
107
+
108
+ // 处理列数据-数组
109
+ const getArrayColumn = () => {
110
+ console.log("adsadsd");
111
+ // 递归处理数据
112
+ const list = [];
113
+
114
+ const c = (columns, list) => {
115
+ columns?.map((item) => {
116
+ const { children, ...p } = item;
117
+ // 递归处理子列
118
+ if (isArray(item.children)) {
119
+ item.children = c(item.children, list);
120
+ }
121
+ list.push(p);
122
+ });
123
+ };
124
+ c(props.columns, list);
125
+ console.log("🚀 ~ getArrayColumn ~ props.columns:", props.columns)
126
+ console.log("🚀 ~ gggggggg:", list);
127
+ return list;
128
+ };
129
+
130
+ // 渲染表格列
131
+ const renderTableColumn = () => {
132
+ const list = [];
133
+
134
+ // 列递归渲染
135
+ const rColumn = (columns, list) => {
136
+ console.log("🚀 ~ rColumn ~ columns:", columns);
137
+ columns?.map((item) => {
138
+ const { children, ...p } = item;
139
+
140
+ // 处理多级表头
141
+ const listSub = [];
142
+ if (children?.length) {
143
+ rColumn(children, listSub);
144
+ }
145
+
146
+ // 处理插槽
147
+ const itemSlot = {};
148
+ // column 自带插槽
149
+ tablecolumnSlots.map((name) => {
150
+ const slotName = `${item.prop}.${name}`;
151
+ if (slots[slotName]) {
152
+ itemSlot[name] = slots[slotName];
153
+ }
154
+ });
155
+
156
+ // column 列插槽
157
+ if (slots[item.prop]) {
158
+ itemSlot["default"] = slots[item.prop];
159
+ }
160
+
161
+ // 赋值
162
+ if (Object.keys(itemSlot).length) {
163
+ list.push(
164
+ h(
165
+ ElTableColumn,
166
+ { ...p, class: "c-table-column" },
167
+ listSub.length
168
+ ? { ...itemSlot, default: () => listSub }
169
+ : { ...itemSlot }
170
+ )
171
+ );
172
+ } else {
173
+ list.push(
174
+ h(
175
+ ElTableColumn,
176
+ { ...p, class: "c-table-column" },
177
+ listSub.length ? { default: () => listSub } : undefined
178
+ )
179
+ );
180
+ }
181
+ });
182
+ };
183
+ rColumn(columnsList.value, list);
184
+ return list;
185
+ };
186
+
187
+ // 插槽处理
188
+ const getSlots = () => {
189
+ const obj = {};
190
+ tableSlots.map((name) => {
191
+ if (slots[name]) {
192
+ obj[name] = slots[name];
193
+ }
194
+ });
195
+ return obj;
196
+ };
197
+ // 渲染表格组件
198
+ const renderTable = () => {
199
+ // getColumnList();
200
+ console.log("props", props);
201
+ console.log("attrs", attrs);
202
+ return h(
203
+ ElTable,
204
+ {
205
+ ref: cTableFnRef,
206
+ ...attrs,
207
+ class: "c-table",
208
+ },
209
+ {
210
+ default: () => renderTableColumn(),
211
+ ...getSlots(),
212
+ }
213
+ );
214
+ };
215
+
216
+ // 返回渲染函数
217
+ return () => renderTable();
218
+ },
219
+ });
@@ -0,0 +1,233 @@
1
+ import {
2
+ defineComponent,
3
+ h,
4
+ getCurrentInstance,
5
+ type ExtractPropTypes,
6
+ } from "vue";
7
+ import { ElTable, ElTableColumn } from "element-plus";
8
+ import {
9
+ defaultAttrs,
10
+ tableSlots,
11
+ tablecolumnSlots,
12
+ selectionColumn,
13
+ indexColumn,
14
+ } from "./constants.ts";
15
+ import { isArray, isObject } from "lodash-es";
16
+ import TableColumn from "./TableColumn.vue"
17
+ const propsAttrs = {
18
+ module: {
19
+ // 公共参数用于业务判断
20
+ type: Object,
21
+ default: () => {},
22
+ },
23
+ // isRadio: { // 是否为单选框
24
+ // type: Boolean,
25
+ // default: false,
26
+ // },
27
+ // isCheckbox: { // 是否为复选框
28
+ // type: Boolean,
29
+ // default: false,
30
+ // },
31
+ columns: {
32
+ // 列数据
33
+ type: Array,
34
+ default: () => [],
35
+ },
36
+ showSelection: {
37
+ // 是否显示选择列
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ showIndex: {
42
+ // 是否显示索引列
43
+ type: Boolean,
44
+ default: false,
45
+ },
46
+ };
47
+
48
+ export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
49
+
50
+ export default defineComponent({
51
+ props: propsAttrs,
52
+ // emits: eventList,
53
+
54
+ // attrs, emit会继承, slots需要设置
55
+ setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
56
+ provide("tableContext", {
57
+ tableSlots: slots,
58
+ events: (eProp, ...args: any) => {
59
+ emit(eProp, ...args);
60
+ },
61
+ });
62
+ // 暴露elTable组件上的方法
63
+ const vm = getCurrentInstance(); // 获取虚拟DOM实例
64
+ const cTableFnRef = (el) => {
65
+ if (!el) return;
66
+ vm.exposed = el; // 设置暴露对象
67
+ vm.exposeProxy = el; // 设置代理暴露对象
68
+ };
69
+
70
+ // 暴露方法
71
+ expose({
72
+ // tableRef,
73
+ });
74
+
75
+ // 属性处理
76
+ const getAttrs = () => {
77
+ const obj = {
78
+ ...defaultAttrs, // 设置默认值
79
+ };
80
+ return obj;
81
+ };
82
+ // 事件处理
83
+ const getEvents = () => {
84
+ const obj = {
85
+ ...defaultAttrs, // 设置默认值
86
+ };
87
+ return obj;
88
+ };
89
+ // 插槽处理
90
+ const getSlots = () => {
91
+ const obj = {};
92
+ tableSlots.map((name) => {
93
+ if (slots[name]) {
94
+ obj[name] = slots[name];
95
+ }
96
+ });
97
+ return obj;
98
+ };
99
+
100
+ // // 处理列数据-数组
101
+ // const getArrayColumn = () => {
102
+ // console.log("adsadsd");
103
+ // // 递归处理数据
104
+ // const list = [];
105
+
106
+ // const c = (columns, list) => {
107
+ // columns?.map((item) => {
108
+ // const { children, ...p } = item;
109
+ // // 递归处理子列
110
+ // if (isArray(item.children)) {
111
+ // item.children = c(item.children, list);
112
+ // }
113
+ // list.push(p);
114
+ // });
115
+ // };
116
+ // c(props.columns, list);
117
+ // console.log("🚀 ~ gggggggg:", list);
118
+ // return list;
119
+ // };
120
+
121
+ // // 渲染表格列
122
+ // const renderTableColumn = () => {
123
+ // const list = [];
124
+ // // 处理多选与序号列
125
+ // if (props.showSelection) {
126
+ // list.push(
127
+ // h(ElTableColumn, {
128
+ // type: "selection",
129
+ // width: 55,
130
+ // })
131
+ // );
132
+ // }
133
+ // if (props.showIndex) {
134
+ // list.push(
135
+ // h(ElTableColumn, {
136
+ // label: "序号",
137
+ // type: "index",
138
+ // width: 55,
139
+ // })
140
+ // );
141
+ // }
142
+
143
+ // // 列递归渲染
144
+ // const rColumn = (columns, list) => {
145
+ // columns.map((item) => {
146
+ // const { children, ...p } = item;
147
+
148
+ // // 处理多级表头
149
+ // const listSub = [];
150
+ // if (children?.length) {
151
+ // rColumn(children, listSub);
152
+ // }
153
+
154
+ // // 处理插槽
155
+ // const itemSlot = {};
156
+ // // column 自带插槽
157
+ // tablecolumnSlots.map((name) => {
158
+ // const slotName = `${item.prop}.${name}`;
159
+ // if (slots[slotName]) {
160
+ // itemSlot[name] = slots[slotName];
161
+ // }
162
+ // });
163
+
164
+ // // column 列插槽
165
+ // if (slots[item.prop]) {
166
+ // itemSlot["default"] = slots[item.prop];
167
+ // }
168
+
169
+ // // 赋值
170
+ // if (Object.keys(itemSlot).length) {
171
+ // list.push(
172
+ // h(
173
+ // ElTableColumn,
174
+ // { ...p, class: "c-table-column" },
175
+ // listSub.length
176
+ // ? { ...itemSlot, default: () => listSub }
177
+ // : { ...itemSlot }
178
+ // )
179
+ // );
180
+ // } else {
181
+ // list.push(
182
+ // h(
183
+ // ElTableColumn,
184
+ // { ...p, class: "c-table-column" },
185
+ // listSub.length ? { default: () => listSub } : undefined
186
+ // )
187
+ // );
188
+ // }
189
+ // });
190
+ // };
191
+ // rColumn(props.columns, list);
192
+ // return list;
193
+ // };
194
+
195
+ const renderTableColumn = () => {
196
+ const list = []
197
+ const rTableColumn = (columnsList, list) => {
198
+
199
+ }
200
+ columns.map((item) => {
201
+
202
+ const { children, ...p } = item;
203
+ // 递归处理子列
204
+ if (isArray(item.children)) {
205
+ item.children = renderTableColumn(item.children);
206
+ }
207
+ })
208
+ }
209
+
210
+ TableColumn
211
+ // 渲染表格组件
212
+ const renderTable = () => {
213
+ // getColumnList();
214
+ console.log("props", props);
215
+ console.log("attrs", attrs);
216
+ return h(
217
+ ElTable,
218
+ {
219
+ ref: cTableFnRef,
220
+ ...attrs,
221
+ class: "c-table",
222
+ },
223
+ {
224
+ default: () => renderTableColumn(),
225
+ ...getSlots(),
226
+ }
227
+ );
228
+ };
229
+
230
+ // 返回渲染函数
231
+ return () => renderTable();
232
+ },
233
+ });
@@ -0,0 +1,21 @@
1
+ <template>
2
+ {{ label }}
3
+ </template>
4
+ <script setup lang="ts">
5
+ import { computed, PropType } from 'vue'
6
+ const props = defineProps({
7
+ options: {
8
+ type: Array,
9
+ default: () => []
10
+ },
11
+ value: {
12
+ type: String as PropType<any>,
13
+ default: ''
14
+ },
15
+ })
16
+ const label = computed(() => {
17
+ // 处理value为数字的情况 后端字典都是字符串
18
+ const item = props.options?.find((item) => item.value == props.value.toString());
19
+ return item?.label || props.value;
20
+ });
21
+ </script>
@@ -0,0 +1,71 @@
1
+ // import { ref, h, computed, toRefs, type ExtractPropTypes } from "vue";
2
+ // import { ElTable, ElTableColumn } from "element-plus";
3
+ // import { defaultAttrs } from "./constants.ts";
4
+
5
+ // const propsAttrs = {};
6
+
7
+ // export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>;
8
+
9
+ // export default {
10
+ // // props: propsAttrs,
11
+ // // emits: eventList,
12
+
13
+ // // attrs, emit会继承, slots需要设置
14
+ // setup(props: PropsAttrs, { attrs, emit, slots, expose }) {
15
+ // // const drawerRef = ref();
16
+
17
+ // // 暴露方法
18
+ // // expose({
19
+ // // drawerRef,
20
+ // // });
21
+
22
+ // // 属性处理
23
+ // const getTAttrs = () => {
24
+ // const obj = {
25
+ // ...defaultAttrs, // 设置默认值
26
+ // };
27
+ // return obj;
28
+ // };
29
+ // // 事件处理
30
+ // const getEvents = () => {
31
+ // const obj = {
32
+ // ...defaultAttrs, // 设置默认值
33
+ // };
34
+ // return obj;
35
+ // };
36
+ // // 插槽处理
37
+ // const getSlots = () => {
38
+ // const obj = {
39
+ // ...defaultAttrs, // 设置默认值
40
+ // };
41
+ // return obj;
42
+ // };
43
+ // const renderTableColumn = () => {
44
+ // return h(
45
+ // ElTableColumn,
46
+ // {
47
+ // // ref: drawerRef,
48
+ // ...getAttrs(),
49
+ // class: "c-drawer",
50
+ // },
51
+ // slots
52
+ // );
53
+ // };
54
+
55
+ // // 渲染表格组件
56
+ // const renderTable = () => {
57
+ // return h(
58
+ // ElTable,
59
+ // {
60
+ // // ref: drawerRef,
61
+ // ...getAttrs(),
62
+ // class: "c-drawer",
63
+ // },
64
+ // slots
65
+ // );
66
+ // };
67
+
68
+ // // 返回渲染函数
69
+ // return () => renderTable();
70
+ // },
71
+ // };
File without changes
File without changes
@@ -0,0 +1,4 @@
1
+ import Table2 from "./src/index";
2
+ export * from "./src/index";
3
+ export { Table2 };
4
+ export default Table2;
@@ -0,0 +1,5 @@
1
+ export const TABLE_CONFIG = {
2
+ OPERATION_COL_LABEL: '操作',
3
+ OPERATION_SLOT_NAME: 'custom',
4
+ CHILDREN_SLOT_KEY: 'children'
5
+ }
@@ -0,0 +1,12 @@
1
+ import { defineComponent } from "vue";
2
+ import render from "./render.ts";
3
+
4
+ export default defineComponent({
5
+ props: ["schema", "data"],
6
+ emits: [],
7
+ setup(props: any, { attrs, emit, slots, expose }) {
8
+ return () => {
9
+ return render(props.schema, props.data, emit, slots);
10
+ };
11
+ },
12
+ });
@@ -0,0 +1,136 @@
1
+ import { h } from "vue";
2
+ import { ElTable, ElTableColumn } from "element-plus";
3
+ import _ from "lodash-es";
4
+ import { TABLE_CONFIG } from "./config.ts";
5
+
6
+ function render(schema: any, data: any, emit: any, slots: any) {
7
+ const renderSlots = {
8
+ default: () => {
9
+ return buildSlots(schema, slots);
10
+ },
11
+ };
12
+ return h(ElTable, { data, class: "c-table" }, renderSlots);
13
+ }
14
+
15
+ function buildSlots(schema: any, slots: any) {
16
+ const children: any[] = [];
17
+ // 渲染表格列子组件
18
+ if (_.isObject(schema)) {
19
+ let columnsKeys = Object.keys(schema);
20
+ columnsKeys.forEach((columnKey) => {
21
+ let colSchema = schema[columnKey];
22
+ let colSlots = slots[columnKey];
23
+ // 如果有列表头插槽
24
+ if (slots[`${columnKey}.header`]) {
25
+ let props = buildColumnProps(columnKey, colSchema);
26
+ let headerSlot = {
27
+ header: (scope: any) => {
28
+ // 调用插槽函数才能传参
29
+ return slots[`${columnKey}.header`](scope);
30
+ },
31
+ };
32
+ if (slots[columnKey]) {
33
+ headerSlot.default = (scope: any) => {
34
+ return [slots[columnKey](scope)];
35
+ };
36
+ }
37
+ children.push(h(ElTableColumn, props, headerSlot));
38
+ } else {
39
+ children.push(buildColumns(columnKey, colSchema, colSlots, slots));
40
+ }
41
+ });
42
+ }
43
+
44
+ // 额外插槽处理
45
+ // 增加插槽式操作栏 判断是否有操作列名称的插槽
46
+ if (slots[TABLE_CONFIG.OPERATION_SLOT_NAME]) {
47
+ // 如果有列表头插槽
48
+ let scopeProp = { label: TABLE_CONFIG.OPERATION_COL_LABEL };
49
+
50
+ if (slots[`${TABLE_CONFIG.OPERATION_SLOT_NAME}.header`]) {
51
+ let headerSlot = {
52
+ header: (scope: any) => {
53
+ // 调用插槽函数才能传参
54
+ return slots[`${TABLE_CONFIG.OPERATION_SLOT_NAME}.header`](scope);
55
+ },
56
+ default: (scope: any) => {
57
+ return [slots[TABLE_CONFIG.OPERATION_SLOT_NAME](scope)];
58
+ },
59
+ };
60
+ children.push(h(ElTableColumn, scopeProp, headerSlot));
61
+ } else {
62
+ let scopeSlots = {
63
+ default: (scope: any) => {
64
+ return [slots[TABLE_CONFIG.OPERATION_SLOT_NAME](scope)];
65
+ },
66
+ };
67
+ children.push(h(ElTableColumn, scopeProp, scopeSlots));
68
+ }
69
+ }
70
+ return children;
71
+ }
72
+
73
+ function buildColumns(
74
+ columnKey: any,
75
+ option: any,
76
+ slots: any,
77
+ globalSlots: any
78
+ ) {
79
+ // 组装props
80
+ let props = buildColumnProps(columnKey, option);
81
+ // 过滤出 children 多级表头配置 消除vue警告
82
+ delete props[TABLE_CONFIG.CHILDREN_SLOT_KEY];
83
+
84
+ let renderSlotsArr = [];
85
+ // 多级表头组合
86
+ if (
87
+ option[TABLE_CONFIG.CHILDREN_SLOT_KEY] &&
88
+ _.isObject(option[TABLE_CONFIG.CHILDREN_SLOT_KEY])
89
+ ) {
90
+ let scopeOption = option[TABLE_CONFIG.CHILDREN_SLOT_KEY];
91
+ if (_.isObject(scopeOption)) {
92
+ let columnsKeys = Object.keys(scopeOption);
93
+ columnsKeys.forEach((columnKey) => {
94
+ let colSchema = scopeOption[columnKey];
95
+ let colSlots = globalSlots[columnKey];
96
+ renderSlotsArr.push(
97
+ buildColumns(columnKey, colSchema, colSlots, globalSlots)
98
+ );
99
+ });
100
+ }
101
+ }
102
+
103
+ let renderSlots = () => [];
104
+
105
+ if (slots) {
106
+ renderSlots = {
107
+ default: (scope) => {
108
+ return [...renderSlotsArr, slots(scope)];
109
+ },
110
+ };
111
+ } else {
112
+ renderSlots = {
113
+ default: () => {
114
+ return [...renderSlotsArr];
115
+ },
116
+ };
117
+ }
118
+
119
+ return h(ElTableColumn, props, renderSlots);
120
+ }
121
+
122
+ function buildColumnProps(key: string, option: any) {
123
+ if (_.isString(option)) {
124
+ return {
125
+ prop: key,
126
+ label: option,
127
+ };
128
+ } else if (_.isObject(option)) {
129
+ return {
130
+ prop: key,
131
+ ...option,
132
+ };
133
+ }
134
+ }
135
+
136
+ export default render;