]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): component root should inherit scopeId from vnode
authorEvan You <yyx990803@gmail.com>
Fri, 26 Jun 2020 21:54:44 +0000 (17:54 -0400)
committerEvan You <yyx990803@gmail.com>
Fri, 26 Jun 2020 21:54:44 +0000 (17:54 -0400)
fix #1399

packages/runtime-core/src/componentRenderUtils.ts

index 060e07f71d84603062388b6390b30286e4c70063..510f8b9af63a789e015d7dfd64e4de6a1b0c125d 100644 (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) {