fix(compiler-ssr): only inject fallthrough attrs for root transition/keep-alive
This commit is contained in:
@@ -290,6 +290,25 @@ describe('ssr: components', () => {
|
||||
}"
|
||||
`)
|
||||
|
||||
// should inject attrs if root with coomments
|
||||
expect(compile(`<!--root--><transition><div/></transition>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_push(\`<!--[--><!--root--><div\${_ssrRenderAttrs(_attrs)}></div><!--]-->\`)
|
||||
}"
|
||||
`)
|
||||
|
||||
// should not inject attrs if not root
|
||||
expect(compile(`<div/><transition><div/></transition>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"
|
||||
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
_push(\`<!--[--><div></div><div></div><!--]-->\`)
|
||||
}"
|
||||
`)
|
||||
|
||||
expect(compile(`<keep-alive><foo/></keep-alive>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { resolveComponent: _resolveComponent } = require(\\"vue\\")
|
||||
|
||||
Reference in New Issue
Block a user