mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +08:00
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:
parent
977767e2e7
commit
88ad652172
@ -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')
|
||||
}
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user