From: daiwei Date: Sat, 8 Feb 2025 07:50:06 +0000 (+0800) Subject: chore: update X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b6ec6e94518edee2d69ab68362903d1f5ec40300;p=thirdparty%2Fvuejs%2Fcore.git chore: update --- 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(``)'), ]),