diff --git a/packages/table/src/table-column/index.ts b/packages/table/src/table-column/index.ts index db0bab14cb..4cb204c900 100644 --- a/packages/table/src/table-column/index.ts +++ b/packages/table/src/table-column/index.ts @@ -88,9 +88,6 @@ export default defineComponent({ const instance = getCurrentInstance() as TableColumn const columnConfig = ref({}) const props = (prop as unknown) as TableColumnCtx - const row = ref({}) - const r = ref({}) - const $index = ref(0) const owner = computed(() => { let parent = instance.parent as any while (parent && !parent.tableId) { @@ -202,24 +199,22 @@ export default defineComponent({ // eslint-disable-next-line instance.columnConfig = columnConfig - return { - row, - r, - $index, - columnId, - columnConfig, - } + return }, render() { - return h( - 'div', - this.$slots.default?.({ - store: {}, - _self: {}, - column: {}, - row: {}, - $index: undefined, - }), - ) + try { + return h( + 'div', + this.$slots.default?.({ + store: {}, + _self: {}, + column: {}, + row: {}, + $index: -1, + }), + ) + } catch { + return h('div') + } }, })