fix(@vant/use): missing subTree when flattening vnodes (#10235)

This commit is contained in:
neverland 2022-01-25 10:59:04 +08:00 committed by GitHub
parent b338aef41f
commit 760fcbb424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -20,6 +20,7 @@ export function flattenVNodes(children: VNodeNormalizedChildren) {
result.push(child);
if (child.component?.subTree) {
result.push(child.component.subTree);
traverse(child.component.subTree.children);
}

View File

@ -15,7 +15,7 @@ exports[`should render Tab inside a component correctly 1`] = `
aria-controls="van-tab"
>
<span class="van-tab__text van-tab__text--ellipsis">
2
1
</span>
</div>
<div id="van-tabs-1"
@ -26,7 +26,7 @@ exports[`should render Tab inside a component correctly 1`] = `
aria-controls="van-tab"
>
<span class="van-tab__text van-tab__text--ellipsis">
1
2
</span>
</div>
<div id="van-tabs-2"
@ -47,15 +47,6 @@ exports[`should render Tab inside a component correctly 1`] = `
</div>
</div>
<div class="van-tabs__content">
<div id="van-tab"
role="tabpanel"
class="van-tab__panel"
tabindex="0"
aria-labelledby="van-tabs-1"
style
>
1
</div>
<div id="van-tab"
role="tabpanel"
class="van-tab__panel"
@ -64,6 +55,15 @@ exports[`should render Tab inside a component correctly 1`] = `
style="display: none;"
>
</div>
<div id="van-tab"
role="tabpanel"
class="van-tab__panel"
tabindex="0"
aria-labelledby="van-tabs-1"
style
>
2
</div>
<div id="van-tab"
role="tabpanel"
class="van-tab__panel"