fix(table): fix #1919 (#1983)

fix #1919

Co-authored-by: winerlu <winerlu@tencent.com>
This commit is contained in:
justwiner
2021-05-21 14:54:36 +08:00
committed by GitHub
parent c23c57d2ba
commit 9b9eb65d44

View File

@@ -7,6 +7,7 @@ import {
watch,
onUnmounted,
onUpdated,
VNode,
} from 'vue'
import { hColgroup } from '../h-helper'
import useLayoutObserver from '../layout-observer'
@@ -74,8 +75,13 @@ export default defineComponent({
[
hColgroup(this.store.states.columns.value),
h('tbody', {}, [
data.reduce((acc, row) => {
return acc.concat(this.wrappedRowRender(row, acc.length))
data.reduce((acc: VNode[], row) => {
return acc.concat(
this.wrappedRowRender(
row,
acc.filter(item => typeof item.key === 'number').length,
),
)
}, []),
]),
],