}
if (!disabled) {
mount(target, targetAnchor)
- updateCssVars(n2)
+ updateCssVars(n2, false)
}
} else if (__DEV__ && !disabled) {
warn(
if (disabled) {
mount(container, mainAnchor)
- updateCssVars(n2)
+ updateCssVars(n2, true)
}
if (isTeleportDeferred(n2.props)) {
)
}
}
- updateCssVars(n2)
+ updateCssVars(n2, disabled)
}
},
querySelector,
))
if (target) {
+ const disabled = isTeleportDisabled(vnode.props)
// if multiple teleports rendered to the same target element, we need to
// pick up from where the last teleport finished instead of the first node
const targetNode =
(target as TeleportTargetElement)._lpa || target.firstChild
if (vnode.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
- if (isTeleportDisabled(vnode.props)) {
+ if (disabled) {
vnode.anchor = hydrateChildren(
nextSibling(node),
vnode,
)
}
}
- updateCssVars(vnode)
+ updateCssVars(vnode, disabled)
}
return vnode.anchor && nextSibling(vnode.anchor as Node)
}
}
}
-function updateCssVars(vnode: VNode) {
+function updateCssVars(vnode: VNode, isDisabled: boolean) {
// presence of .ut method indicates owner component uses css vars.
// code path here can assume browser environment.
const ctx = vnode.ctx
if (ctx && ctx.ut) {
- let node = vnode.targetStart
- while (node && node !== vnode.targetAnchor) {
+ let node, anchor
+ if (isDisabled) {
+ node = vnode.el
+ anchor = vnode.anchor
+ } else {
+ node = vnode.targetStart
+ anchor = vnode.targetAnchor
+ }
+ while (node && node !== anchor) {
if (node.nodeType === 1) node.setAttribute('data-v-owner', ctx.uid)
node = node.nextSibling
}