Skip to content

Commit f3f94e4

Browse files
committed
fix(runtime-core): component root should inherit scopeId from vnode
fix #1399
1 parent 70ea76a commit f3f94e4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/runtime-core/src/componentRenderUtils.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export function renderComponentRoot(
4242
): VNode {
4343
const {
4444
type: Component,
45-
parent,
4645
vnode,
4746
proxy,
4847
withProxy,
@@ -149,9 +148,8 @@ export function renderComponentRoot(
149148
}
150149

151150
// inherit scopeId
152-
const parentScopeId = parent && parent.type.__scopeId
153-
if (parentScopeId) {
154-
root = cloneVNode(root, { [parentScopeId]: '' })
151+
if (vnode.scopeId) {
152+
root = cloneVNode(root, { [vnode.scopeId]: '' })
155153
}
156154
// inherit directives
157155
if (vnode.dirs) {

0 commit comments

Comments
 (0)