From b6ec6e94518edee2d69ab68362903d1f5ec40300 Mon Sep 17 00:00:00 2001 From: daiwei Date: Sat, 8 Feb 2025 15:50:06 +0800 Subject: [PATCH] chore: update --- .../compiler-ssr/__tests__/ssrTransitionGroup.spec.ts | 8 ++++---- .../src/transforms/ssrTransformTransitionGroup.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts b/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts index af83e3032e..99a9933f1e 100644 --- a/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts +++ b/packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts @@ -11,7 +11,7 @@ describe('transition-group', () => { "const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer") return function ssrRender(_ctx, _push, _parent, _attrs) { - if (_attrs.tag) { + if (_attrs && _attrs.tag) { _push(\`<\${_attrs.tag}>\`) } _push(\`\`) @@ -19,7 +19,7 @@ describe('transition-group', () => { _push(\`
\`) }) _push(\`\`) - if (_attrs.tag) { + if (_attrs && _attrs.tag) { _push(\`\`) } }" @@ -120,7 +120,7 @@ describe('transition-group', () => { "const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer") return function ssrRender(_ctx, _push, _parent, _attrs) { - if (_attrs.tag) { + if (_attrs && _attrs.tag) { _push(\`<\${_attrs.tag}>\`) } _push(\`\`) @@ -134,7 +134,7 @@ describe('transition-group', () => { _push(\`
ok
\`) } _push(\`\`) - if (_attrs.tag) { + if (_attrs && _attrs.tag) { _push(\`\`) } }" diff --git a/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts b/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts index c88142c2ed..4945d1e3a8 100644 --- a/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts +++ b/packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts @@ -127,7 +127,7 @@ export function ssrProcessTransitionGroup( if (hasFallthroughAttrs) { context.pushStatement( createIfStatement( - createSimpleExpression('_attrs.tag'), + createSimpleExpression('_attrs && _attrs.tag'), createBlockStatement([ createSimpleExpression('_push(`<${_attrs.tag}>`)'), ]), @@ -140,7 +140,7 @@ export function ssrProcessTransitionGroup( if (hasFallthroughAttrs) { context.pushStatement( createIfStatement( - createSimpleExpression('_attrs.tag'), + createSimpleExpression('_attrs && _attrs.tag'), createBlockStatement([ createSimpleExpression('_push(``)'), ]), -- 2.47.2