fix(table): avoiding the error of el-table-column rendering (#828)

fix #793

Co-authored-by: winerlu <winerlu@tencent.com>
This commit is contained in:
justwiner 2020-12-07 10:35:42 +08:00 committed by GitHub
parent 977767e2e7
commit 88ad652172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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