fix(tabs): [tabs] Fix the bug where the name is empty caused by using v-if in tabstem (#1549)

This commit is contained in:
chenxi-20 2024-04-11 09:02:42 -07:00 committed by GitHub
parent 5e3b90e45f
commit c64c373b94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -28,10 +28,12 @@ export const calcPaneInstances =
tabItemVNodes().forEach((vnode) => {
if (Array.isArray(vnode.children)) {
vnode.children.forEach((child) => {
orderPanes.push(child.props?.name)
const name = child.props?.name
name && orderPanes.push(name)
})
} else {
orderPanes.push(vnode.props?.name)
const name = vnode.props?.name
name && orderPanes.push(name)
}
})
const currentPanes = [] as ITabsPaneVm[]