diff --git a/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts b/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts index 905e6a4895d..431ebaa77ee 100644 --- a/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts +++ b/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts @@ -38,6 +38,28 @@ describe('transition-group', () => { `) }) + // #11514 + test('with static tag + comment', () => { + expect( + compile( + `
`, + ).code, + ).toMatchInlineSnapshot(` + "const { ssrRenderAttrs: _ssrRenderAttrs, ssrRenderList: _ssrRenderList } = require("vue/server-renderer") + + return function ssrRender(_ctx, _push, _parent, _attrs) { + _push(\`\`) + _ssrRenderList(_ctx.list, (i) => { + _push(\`
\`) + }) + if (false) { + _push(\`
\`) + } + _push(\`\`) + }" + `) + }) + test('with dynamic tag', () => { expect( compile( diff --git a/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts b/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts index a2e284ae841..1d99a691094 100644 --- a/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts +++ b/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts @@ -108,7 +108,7 @@ export function ssrProcessTransitionGroup( context.pushStringPart(` ${scopeId}`) } context.pushStringPart(`>`) - processChildren(node, context, false, true) + processChildren(node, context, false, true, true) context.pushStringPart(``) } } else {