Skip to content

Commit b6ec6e9

Browse files
committed
chore: update
1 parent feadb33 commit b6ec6e9

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/compiler-ssr/__tests__/ssrTransitionGroup.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ describe('transition-group', () => {
1111
"const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer")
1212
1313
return function ssrRender(_ctx, _push, _parent, _attrs) {
14-
if (_attrs.tag) {
14+
if (_attrs && _attrs.tag) {
1515
_push(\`<\${_attrs.tag}>\`)
1616
}
1717
_push(\`<!--[-->\`)
1818
_ssrRenderList(_ctx.list, (i) => {
1919
_push(\`<div></div>\`)
2020
})
2121
_push(\`<!--]-->\`)
22-
if (_attrs.tag) {
22+
if (_attrs && _attrs.tag) {
2323
_push(\`</\${_attrs.tag}>\`)
2424
}
2525
}"
@@ -120,7 +120,7 @@ describe('transition-group', () => {
120120
"const { ssrRenderList: _ssrRenderList } = require("vue/server-renderer")
121121
122122
return function ssrRender(_ctx, _push, _parent, _attrs) {
123-
if (_attrs.tag) {
123+
if (_attrs && _attrs.tag) {
124124
_push(\`<\${_attrs.tag}>\`)
125125
}
126126
_push(\`<!--[-->\`)
@@ -134,7 +134,7 @@ describe('transition-group', () => {
134134
_push(\`<div>ok</div>\`)
135135
}
136136
_push(\`<!--]-->\`)
137-
if (_attrs.tag) {
137+
if (_attrs && _attrs.tag) {
138138
_push(\`</\${_attrs.tag}>\`)
139139
}
140140
}"

packages/compiler-ssr/src/transforms/ssrTransformTransitionGroup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export function ssrProcessTransitionGroup(
127127
if (hasFallthroughAttrs) {
128128
context.pushStatement(
129129
createIfStatement(
130-
createSimpleExpression('_attrs.tag'),
130+
createSimpleExpression('_attrs && _attrs.tag'),
131131
createBlockStatement([
132132
createSimpleExpression('_push(`<${_attrs.tag}>`)'),
133133
]),
@@ -140,7 +140,7 @@ export function ssrProcessTransitionGroup(
140140
if (hasFallthroughAttrs) {
141141
context.pushStatement(
142142
createIfStatement(
143-
createSimpleExpression('_attrs.tag'),
143+
createSimpleExpression('_attrs && _attrs.tag'),
144144
createBlockStatement([
145145
createSimpleExpression('_push(`</${_attrs.tag}>`)'),
146146
]),

0 commit comments

Comments
 (0)