Skip to content

Commit

Permalink
fix(runtime-core): component root should inherit scopeId from vnode
Browse files Browse the repository at this point in the history
fix #1399
  • Loading branch information
yyx990803 committed Jun 26, 2020
1 parent 70ea76a commit f3f94e4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/runtime-core/src/componentRenderUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export function renderComponentRoot(
): VNode {
const {
type: Component,
parent,
vnode,
proxy,
withProxy,
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f3f94e4

Please sign in to comment.