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 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')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user