fix(ssr): fix hydration error for slot outlet inside transition
fix #3989
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { compile } from '../src'
|
||||
import { ssrHelpers, SSR_RENDER_SLOT_INNER } from '../src/runtimeHelpers'
|
||||
|
||||
describe('ssr: <slot>', () => {
|
||||
test('basic', () => {
|
||||
@@ -114,4 +115,16 @@ describe('ssr: <slot>', () => {
|
||||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
test('inside transition', () => {
|
||||
const { code } = compile(`<transition><slot/></transition>`)
|
||||
expect(code).toMatch(ssrHelpers[SSR_RENDER_SLOT_INNER])
|
||||
expect(code).toMatchInlineSnapshot(`
|
||||
"const { ssrRenderSlotInner: _ssrRenderSlotInner } = require(\\"vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_ssrRenderSlotInner(_ctx.$slots, \\"default\\", {}, null, _push, _parent)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user