Просмотр исходного кода

fix(runtime-vapor): pass parentComp to _injectChildStyle for correct style ordering

daiwei 1 месяц назад
Родитель
Сommit
79190e845b
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      packages/runtime-vapor/src/component.ts

+ 4 - 1
packages/runtime-vapor/src/component.ts

@@ -888,7 +888,10 @@ export function mountComponent(
   // custom element style injection
   const { root, type } = instance as GenericComponentInstance
   if (root && root.ce && (root.ce as VaporElement)._hasShadowRoot()) {
-    root.ce!._injectChildStyle(type)
+    root.ce!._injectChildStyle(
+      type,
+      instance.parent ? instance.parent.type : undefined,
+    )
   }
 
   if (__DEV__) {