fix(sfc): inherit parent scopeId on child rooot (#756)
This commit is contained in:
@@ -39,6 +39,7 @@ export function renderComponentRoot(
|
||||
): VNode {
|
||||
const {
|
||||
type: Component,
|
||||
parent,
|
||||
vnode,
|
||||
proxy,
|
||||
withProxy,
|
||||
@@ -102,6 +103,11 @@ export function renderComponentRoot(
|
||||
if (vnodeHooks !== EMPTY_OBJ) {
|
||||
result = cloneVNode(result, vnodeHooks)
|
||||
}
|
||||
// inherit scopeId
|
||||
const parentScopeId = parent && parent.type.__scopeId
|
||||
if (parentScopeId) {
|
||||
result = cloneVNode(result, { [parentScopeId]: '' })
|
||||
}
|
||||
// inherit directives
|
||||
if (vnode.dirs != null) {
|
||||
if (__DEV__ && !isElementRoot(result)) {
|
||||
@@ -127,6 +133,7 @@ export function renderComponentRoot(
|
||||
result = createVNode(Comment)
|
||||
}
|
||||
currentRenderingInstance = null
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user