]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: update
authordaiwei <daiwei521@126.com>
Sat, 8 Feb 2025 07:50:06 +0000 (15:50 +0800)
committerdaiwei <daiwei521@126.com>
Sat, 8 Feb 2025 07:50:06 +0000 (15:50 +0800)
packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts
packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts

index af83e3032e6de63671d1cc4611ba9df264df1339..99a9933f1e65a9afb647684ca68685ea6168eaac 100644 (file)
@@ -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(\`<div></div>\`)
         })
         _push(\`<!--]-->\`)
-        if (_attrs.tag) {
+        if (_attrs && _attrs.tag) {
           _push(\`</\${_attrs.tag}>\`)
         }
       }"
@@ -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(\`<div>ok</div>\`)
         }
         _push(\`<!--]-->\`)
-        if (_attrs.tag) {
+        if (_attrs && _attrs.tag) {
           _push(\`</\${_attrs.tag}>\`)
         }
       }"
index c88142c2ede38ff7757c3cd18d2959579582ab87..4945d1e3a845a00a326b74adb731726de8934723 100644 (file)
@@ -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(`</${_attrs.tag}>`)'),
           ]),