Skip to content

Commit

Permalink
wip: update
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Sep 12, 2024
1 parent 8868f88 commit dfa61f5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,14 @@ export function renderComponentRoot(
}
}

// #5407
if (root.type === Fragment) {
if (isArray(root.children)) {
const singleRoot = filterSingleRoot(root.children)
if (singleRoot) root = singleRoot
}
}

// inherit directives
if (vnode.dirs) {
if (__DEV__ && !isElementRoot(root)) {
Expand All @@ -251,12 +259,7 @@ export function renderComponentRoot(
}
// clone before mutating since the root may be a hoisted vnode
root = cloneVNode(root, null, false, true)
if (root.type === Fragment) {
if (isArray(root.children)) {
const singleRoot = filterSingleRoot(root.children)
if (singleRoot) root = singleRoot
}
}

root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs
}
// inherit transition data
Expand Down

0 comments on commit dfa61f5

Please sign in to comment.