feat(compiler-ssr): compile portal (#775)

This commit is contained in:
Dmitry Sharshakov
2020-02-26 22:59:53 +03:00
committed by GitHub
parent 312513d255
commit d8ed0e7fbf
8 changed files with 109 additions and 10 deletions

View File

@@ -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)
}"
`)
})
})
})