fix(table): fix: fix bug of table crash under complex data (#1805)

fix #1733

Co-authored-by: winerlu <winerlu@tencent.com>
This commit is contained in:
justwiner 2021-04-11 21:01:01 +08:00 committed by GitHub
parent 77ab8ae0d8
commit 44fbd9f39f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -143,7 +143,7 @@ export function defaultRenderCell({
if (column && column.formatter) {
return column.formatter(row, column, value, $index)
}
return value
return value?.toString?.() || ''
}
export function treeCellPrefix({

View File

@ -9,7 +9,6 @@ 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
@ -128,7 +127,7 @@ function useRender(props: TableColumnCtx, slots, owner: ComputedRef<any>) {
}
}
checkSubColumn(children)
return h('div', props, [prefix, cloneDeep(children)])
return h('div', props, [prefix, children])
}
}
return column