fix(runtime-core): component root should inherit scopeId from vnode

fix #1399
This commit is contained in:
Evan You 2020-06-26 17:54:44 -04:00
parent 70ea76ae0c
commit f3f94e4deb

View File

@ -42,7 +42,6 @@ export function renderComponentRoot(
): VNode {
const {
type: Component,
parent,
vnode,
proxy,
withProxy,
@ -149,9 +148,8 @@ export function renderComponentRoot(
}
// inherit scopeId
const parentScopeId = parent && parent.type.__scopeId
if (parentScopeId) {
root = cloneVNode(root, { [parentScopeId]: '' })
if (vnode.scopeId) {
root = cloneVNode(root, { [vnode.scopeId]: '' })
}
// inherit directives
if (vnode.dirs) {