fix(table): fix bug caused by dynamic rendering (#1640)

fix #1626

Co-authored-by: winerlu <winerlu@tencent.com>
This commit is contained in:
justwiner 2021-03-22 09:22:35 +08:00 committed by GitHub
parent 8ea4c16e34
commit 6822cafda8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import {
import { cellForced, defaultRenderCell, treeCellPrefix } from '../config'
import { parseWidth, parseMinWidth } from '../util'
import { TableColumn, TableColumnCtx } from '../table.type'
import cloneDeep from 'lodash/cloneDeep'
function useRender(props: TableColumnCtx, slots, owner: ComputedRef<any>) {
const instance = (getCurrentInstance() as unknown) as TableColumn
@ -127,7 +128,7 @@ function useRender(props: TableColumnCtx, slots, owner: ComputedRef<any>) {
}
}
checkSubColumn(children)
return h('div', props, [prefix, children])
return h('div', props, [prefix, cloneDeep(children)])
}
}
return column