feat(compiler-ssr): compile portal (#775)
This commit is contained in:
committed by
GitHub
parent
312513d255
commit
d8ed0e7fbf
@@ -309,5 +309,18 @@ describe('ssr: components', () => {
|
||||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
test('portal rendering', () => {
|
||||
expect(compile(`<portal :target="target"><div/></portal>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { ssrRenderPortal: _ssrRenderPortal } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_ssrRenderPortal((_push) => {
|
||||
_push(\`<div></div>\`)
|
||||
}, _ctx.target, _parent)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user