Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhe141 committed Oct 5, 2024
1 parent 03af831 commit 2f3321e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/runtime-core/src/components/Teleport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,12 +463,20 @@ export const Teleport = TeleportImpl as unknown as {
}

function updateCssVars(vnode: VNode) {
const isDisabled = isTeleportDisabled(vnode.props)
// 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 || (vnode.children as VNode[])[0].el!
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
}
Expand Down

0 comments on commit 2f3321e

Please sign in to comment.