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

Function mountToTarget

packages/runtime-core/src/components/Teleport.ts:131–158  ·  view source on GitHub ↗
(vnode: TeleportVNode = n2)

Source from the content-addressed store, hash-verified

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'
139 } else if (namespace !== 'mathml' && isTargetMathML(target)) {
140 namespace = 'mathml'
141 }
142
143 // track CE teleport targets
144 if (parentComponent && parentComponent.isCE) {
145 ;(
146 parentComponent.ce!._teleportTargets ||
147 (parentComponent.ce!._teleportTargets = new Set())
148 ).add(target)
149 }
150
151 if (!disabled) {
152 mount(vnode, target, targetAnchor)
153 updateCssVars(vnode, false)
154 }
155 } else if (__DEV__ && !disabled) {
156 warn('Invalid Teleport target on mount:', target, `(${typeof target})`)
157 }
158 }
159
160 const queuePendingMount = (vnode: TeleportVNode) => {
161 const mountJob: SchedulerJob = () => {

Callers 2

mountJobFunction · 0.85
processFunction · 0.85

Calls 8

warnFunction · 0.90
isTeleportDisabledFunction · 0.85
resolveTargetFunction · 0.85
prepareAnchorFunction · 0.85
isTargetSVGFunction · 0.85
isTargetMathMLFunction · 0.85
updateCssVarsFunction · 0.85
mountFunction · 0.70

Tested by

no test coverage detected