Skip to content

Commit 9acce54

Browse files
committed
chore: improve code
1 parent 4bc0ed9 commit 9acce54

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/runtime-dom/src/components/TransitionGroup.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ const TransitionGroupImpl: ComponentOptions = {
113113
tag = 'span'
114114
}
115115

116-
prevChildren = children
116+
prevChildren =
117+
children && children.filter(child => !isComment(child.el as Element))
117118
children = slots.default ? getTransitionRawChildren(slots.default()) : []
118119

119120
for (let i = 0; i < children.length; i++) {
@@ -129,9 +130,6 @@ const TransitionGroupImpl: ComponentOptions = {
129130
}
130131

131132
if (prevChildren) {
132-
prevChildren = prevChildren.filter(
133-
child => !isComment(child.el as Element)
134-
)
135133
for (let i = 0; i < prevChildren.length; i++) {
136134
const child = prevChildren[i]
137135
setTransitionHooks(

0 commit comments

Comments
 (0)