fix(ssr): hydration for transition wrapper components with empty slot content (#5995)

fix #5991
This commit is contained in:
小刘(liulinboyi)
2022-06-06 16:24:40 +08:00
committed by GitHub
parent 0cf9ae62be
commit eb22a62798
4 changed files with 43 additions and 6 deletions

View File

@@ -113,4 +113,32 @@ describe('ssr: slot', () => {
`<div><!--[--><!--[--><div>one</div><div>two</div><!--]--><!--]--></div>`
)
})
test('transition slot', async () => {
expect(
await renderToString(
createApp({
components: {
one: {
template: `<transition><slot/></transition>`
}
},
template: `<one><div v-if="false">foo</div></one>`
})
)
).toBe(`<!---->`)
expect(
await renderToString(
createApp({
components: {
one: {
template: `<transition><slot/></transition>`
}
},
template: `<one><div v-if="true">foo</div></one>`
})
)
).toBe(`<div>foo</div>`)
})
})