Skip to content

Commit

Permalink
fix(runtime-core): clone root vnode before inheriting directives
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 12, 2022
1 parent 9ecee16 commit d36ca4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export function renderComponentRoot(
`The directives will not function as intended.`
)
}
// clone before mutating since the root may be a hoisted vnode
root = cloneVNode(root)
root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs
}
// inherit transition data
Expand Down

0 comments on commit d36ca4d

Please sign in to comment.