|
|
@@ -223,7 +223,7 @@ export const TeleportImpl = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- updateCssVars(parentComponent, n2)
|
|
|
+ updateCssVars(n2)
|
|
|
},
|
|
|
|
|
|
remove(
|
|
|
@@ -385,7 +385,7 @@ function hydrateTeleport(
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
- updateCssVars(parentComponent, vnode)
|
|
|
+ updateCssVars(vnode)
|
|
|
}
|
|
|
return vnode.anchor && nextSibling(vnode.anchor as Node)
|
|
|
}
|
|
|
@@ -396,19 +396,16 @@ export const Teleport = TeleportImpl as unknown as {
|
|
|
new (): { $props: VNodeProps & TeleportProps }
|
|
|
}
|
|
|
|
|
|
-function updateCssVars(
|
|
|
- parentComponent: ComponentInternalInstance | null,
|
|
|
- vnode: VNode
|
|
|
-) {
|
|
|
+function updateCssVars(vnode: VNode) {
|
|
|
// presence of .ut method indicates owner component uses css vars.
|
|
|
// code path here can assume browser environment.
|
|
|
- if (parentComponent && parentComponent.ut) {
|
|
|
+ const ctx = vnode.ctx
|
|
|
+ if (ctx && ctx.ut) {
|
|
|
let node = (vnode.children as VNode[])[0].el!
|
|
|
while (node !== vnode.targetAnchor) {
|
|
|
- if (node.nodeType === 1)
|
|
|
- node.setAttribute('data-v-owner', parentComponent.uid)
|
|
|
+ if (node.nodeType === 1) node.setAttribute('data-v-owner', ctx.uid)
|
|
|
node = node.nextSibling
|
|
|
}
|
|
|
- parentComponent.ut()
|
|
|
+ ctx.ut()
|
|
|
}
|
|
|
}
|