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

Function process

packages/runtime-core/src/components/Teleport.ts:81–313  ·  view source on GitHub ↗
(
    n1: TeleportVNode | null,
    n2: TeleportVNode,
    container: RendererElement,
    anchor: RendererNode | null,
    parentComponent: ComponentInternalInstance | null,
    parentSuspense: SuspenseBoundary | null,
    namespace: ElementNamespace,
    slotScopeIds: string[] | null,
    optimized: boolean,
    internals: RendererInternals,
  )

Source from the content-addressed store, hash-verified

79 name: 'Teleport',
80 __isTeleport: true,
81 process(
82 n1: TeleportVNode | null,
83 n2: TeleportVNode,
84 container: RendererElement,
85 anchor: RendererNode | null,
86 parentComponent: ComponentInternalInstance | null,
87 parentSuspense: SuspenseBoundary | null,
88 namespace: ElementNamespace,
89 slotScopeIds: string[] | null,
90 optimized: boolean,
91 internals: RendererInternals,
92 ): void {
93 const {
94 mc: mountChildren,
95 pc: patchChildren,
96 pbc: patchBlockChildren,
97 o: { insert, querySelector, createText, createComment, parentNode },
98 } = internals
99
100 const disabled = isTeleportDisabled(n2.props)
101 let { dynamicChildren } = n2
102
103 // #3302
104 // HMR updated, force full diff
105 if (__DEV__ && isHmrUpdating) {
106 optimized = false
107 dynamicChildren = null
108 }
109
110 const mount = (
111 vnode: TeleportVNode,
112 container: RendererElement,
113 anchor: RendererNode,
114 ) => {
115 // Teleport *always* has Array children. This is enforced in both the
116 // compiler and vnode children normalization.
117 if (vnode.shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
118 mountChildren(
119 vnode.children as VNodeArrayChildren,
120 container,
121 anchor,
122 parentComponent,
123 parentSuspense,
124 namespace,
125 slotScopeIds,
126 optimized,
127 )
128 }
129 }
130
131 const mountToTarget = (vnode: TeleportVNode = n2) => {
132 const disabled = isTeleportDisabled(vnode.props)
133 const target = (vnode.target = resolveTarget(vnode.props, querySelector))
134 const targetAnchor = prepareAnchor(target, vnode, createText, insert)
135 if (target) {
136 // #2652 we could be teleporting from a non-SVG tree into an SVG tree
137 if (namespace !== 'svg' && isTargetSVG(target)) {
138 namespace = 'svg'

Callers 2

triggerEventFunction · 0.50
triggerEventFunction · 0.50

Calls 15

traverseStaticChildrenFunction · 0.90
warnFunction · 0.90
isTeleportDisabledFunction · 0.85
createCommentFunction · 0.85
createTextFunction · 0.85
insertFunction · 0.85
isTeleportDeferredFunction · 0.85
queuePendingMountFunction · 0.85
updateCssVarsFunction · 0.85
mountToTargetFunction · 0.85
isTargetSVGFunction · 0.85
isTargetMathMLFunction · 0.85

Tested by 2

triggerEventFunction · 0.40
triggerEventFunction · 0.40