fix(compiler-ssr): should pass necessary tag names for dynamic v-bind
This commit is contained in:
@@ -57,13 +57,27 @@ describe('ssr: element', () => {
|
||||
let _temp0
|
||||
|
||||
_push(\`<textarea\${
|
||||
_ssrRenderAttrs(_temp0 = _ctx.obj)
|
||||
_ssrRenderAttrs(_temp0 = _ctx.obj, \\"textarea\\")
|
||||
}>\${
|
||||
_ssrInterpolate((\\"value\\" in _temp0) ? _temp0.value : \\"fallback\\")
|
||||
}</textarea>\`)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
test('should pass tag to custom elements w/ dynamic v-bind', () => {
|
||||
expect(
|
||||
compile(`<my-foo v-bind="obj"></my-foo>`, {
|
||||
isCustomElement: () => true
|
||||
}).code
|
||||
).toMatchInlineSnapshot(`
|
||||
"const { ssrRenderAttrs: _ssrRenderAttrs } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(\`<my-foo\${_ssrRenderAttrs(_ctx.obj, \\"my-foo\\")}></my-foo>\`)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
})
|
||||
|
||||
describe('attrs', () => {
|
||||
|
||||
Reference in New Issue
Block a user