fix(compiler-ssr) ensure that ssrHelpers are unique after merge from parent context (#3269)
fix #3268
This commit is contained in:
@@ -71,6 +71,27 @@ describe('ssr: element', () => {
|
||||
`)
|
||||
})
|
||||
|
||||
test("multiple _ssrInterpolate at parent and child import dependency once", () => {
|
||||
expect( compile(`<div>{{ hello }}<textarea v-bind="a"></textarea></div>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { ssrRenderAttrs: _ssrRenderAttrs, ssrInterpolate: _ssrInterpolate } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent, _attrs) {
|
||||
let _temp0
|
||||
|
||||
_push(\`<div\${
|
||||
_ssrRenderAttrs(_attrs)
|
||||
}>\${
|
||||
_ssrInterpolate(_ctx.hello)
|
||||
}<textarea\${
|
||||
_ssrRenderAttrs(_temp0 = _ctx.a, \\"textarea\\")
|
||||
}>\${
|
||||
_ssrInterpolate((\\"value\\" in _temp0) ? _temp0.value : \\"\\")
|
||||
}</textarea></div>\`)
|
||||
}"
|
||||
`);
|
||||
});
|
||||
|
||||
test('should pass tag to custom elements w/ dynamic v-bind', () => {
|
||||
expect(
|
||||
compile(`<my-foo v-bind="obj"></my-foo>`, {
|
||||
|
||||
Reference in New Issue
Block a user