"const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer")
return function ssrRender(_ctx, _push, _parent, _attrs) {
- const _tag = _attrs && _attrs.tag
+ const _tag = (_attrs && typeof _attrs.tag === 'string') ? _attrs.tag : ''
if (_tag) {
_push(\`<\${_tag}>\`)
}
"const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer")
return function ssrRender(_ctx, _push, _parent, _attrs) {
- const _tag = _attrs && _attrs.tag
+ const _tag = (_attrs && typeof _attrs.tag === 'string') ? _attrs.tag : ''
if (_tag) {
_push(\`<\${_tag}>\`)
}
context.pushStringPart(`</${tag.value!.content}>`)
}
} else {
- // #12827 _attrs fallthrough may contain tag property
+ // _attrs may contain tag property
const hasFallthroughAttrs = node.props.some(
p =>
p.type === NodeTypes.DIRECTIVE &&
)
if (hasFallthroughAttrs) {
context.pushStatement(
- createSimpleExpression('const _tag = _attrs && _attrs.tag'),
+ createSimpleExpression(
+ `const _tag = (_attrs && typeof _attrs.tag === 'string') ? _attrs.tag : ''`,
+ ),
)
context.pushStatement(
createIfStatement(
`<div id="foo" class="bar baz"></div>`,
)
})
+
+ // #12827
+ test('with transition-group tag name', async () => {
+ expect(
+ await renderToString(
+ createApp({
+ components: {
+ one: {
+ template: `<TransitionGroup><slot/></TransitionGroup>`,
+ },
+ },
+ template: `<one tag="div"><p v-for="i in 2">{{i}}</p></one>`,
+ }),
+ ),
+ ).toBe(`<div><!--[--><p>1</p><p>2</p><!--]--></div>`)
+ })
})