fix(talbe): null check error (#1807)

This commit is contained in:
xiejiahe 2021-04-13 10:31:38 +08:00 committed by GitHub
parent 6582b7cdbc
commit ee7e9c0a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ function useLayoutObserver(root: Table) {
return layout
})
const onColumnsChange = (layout: TableLayout) => {
const cols = root.vnode.el?.querySelectorAll('colgroup > col')
const cols = root.vnode.el?.querySelectorAll('colgroup > col') || []
if (!cols.length) return
const flattenColumns = layout.getFlattenColumns()
const columnsMap = {}