feat(ssr): compiler-ssr support for Suspense
This commit is contained in:
16
packages/compiler-ssr/__tests__/ssrPortal.spec.ts
Normal file
16
packages/compiler-ssr/__tests__/ssrPortal.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { compile } from '../src'
|
||||
|
||||
describe('ssr compile: portal', () => {
|
||||
test('should work', () => {
|
||||
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