MCPcopy
hub / github.com/vuejs/core / updateHOCHostEl

Function updateHOCHostEl

packages/runtime-core/src/componentRenderUtils.ts:473–496  ·  view source on GitHub ↗
(
  { vnode, parent, suspense }: ComponentInternalInstance,
  el: typeof vnode.el, // HostNode
)

Source from the content-addressed store, hash-verified

471}
472
473export function updateHOCHostEl(
474 { vnode, parent, suspense }: ComponentInternalInstance,
475 el: typeof vnode.el, // HostNode
476): void {
477 while (parent) {
478 const root = parent.subTree
479 if (root.suspense && root.suspense.activeBranch === vnode) {
480 // Suspense proxies its active branch host node, so keep propagating from
481 // the boundary vnode to any wrapper components above it.
482 root.suspense.vnode.el = root.el = el
483 vnode = root
484 }
485 if (root === vnode) {
486 ;(vnode = parent.vnode).el = el
487 parent = parent.parent
488 } else {
489 break
490 }
491 }
492 // also update suspense vnode el
493 if (suspense && suspense.activeBranch === vnode) {
494 suspense.vnode.el = el
495 }
496}

Callers 4

componentUpdateFnFunction · 0.90
handleMismatchFunction · 0.90
registerDepFunction · 0.90
setActiveBranchFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected