initRender() — vue Function Reference
Architecture documentation for the initRender() function in render.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD f4a31343_8d36_5571_8c89_ce5e074a5044["initRender()"] a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d["render.ts"] f4a31343_8d36_5571_8c89_ce5e074a5044 -->|defined in| a8c0285c_59b2_d81b_1af0_c0cd9c2afe2d 7cb38e61_0473_03dc_2a46_4308c941e8cf["initMixin()"] 7cb38e61_0473_03dc_2a46_4308c941e8cf -->|calls| f4a31343_8d36_5571_8c89_ce5e074a5044 23d9ce46_8163_f008_2464_0fc0040f465c["resolveSlots()"] f4a31343_8d36_5571_8c89_ce5e074a5044 -->|calls| 23d9ce46_8163_f008_2464_0fc0040f465c 1e1e5127_e2df_8612_b7e7_d738cde5407a["normalizeScopedSlots()"] f4a31343_8d36_5571_8c89_ce5e074a5044 -->|calls| 1e1e5127_e2df_8612_b7e7_d738cde5407a 2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd["createElement()"] f4a31343_8d36_5571_8c89_ce5e074a5044 -->|calls| 2c55eb58_ce03_1c5e_ac99_4fc1ef41c3cd style f4a31343_8d36_5571_8c89_ce5e074a5044 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/core/instance/render.ts lines 21–86
export function initRender(vm: Component) {
vm._vnode = null // the root of the child tree
vm._staticTrees = null // v-once cached trees
const options = vm.$options
const parentVnode = (vm.$vnode = options._parentVnode!) // the placeholder node in parent tree
const renderContext = parentVnode && (parentVnode.context as Component)
vm.$slots = resolveSlots(options._renderChildren, renderContext)
vm.$scopedSlots = parentVnode
? normalizeScopedSlots(
vm.$parent!,
parentVnode.data!.scopedSlots,
vm.$slots
)
: emptyObject
// bind the createElement fn to this instance
// so that we get proper render context inside it.
// args order: tag, data, children, normalizationType, alwaysNormalize
// internal version is used by render functions compiled from templates
// @ts-expect-error
vm._c = (a, b, c, d) => createElement(vm, a, b, c, d, false)
// normalization is always applied for the public version, used in
// user-written render functions.
// @ts-expect-error
vm.$createElement = (a, b, c, d) => createElement(vm, a, b, c, d, true)
// $attrs & $listeners are exposed for easier HOC creation.
// they need to be reactive so that HOCs using them are always updated
const parentData = parentVnode && parentVnode.data
/* istanbul ignore else */
if (__DEV__) {
defineReactive(
vm,
'$attrs',
(parentData && parentData.attrs) || emptyObject,
() => {
!isUpdatingChildComponent && warn(`$attrs is readonly.`, vm)
},
true
)
defineReactive(
vm,
'$listeners',
options._parentListeners || emptyObject,
() => {
!isUpdatingChildComponent && warn(`$listeners is readonly.`, vm)
},
true
)
} else {
defineReactive(
vm,
'$attrs',
(parentData && parentData.attrs) || emptyObject,
null,
true
)
defineReactive(
vm,
'$listeners',
options._parentListeners || emptyObject,
null,
true
)
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does initRender() do?
initRender() is a function in the vue codebase, defined in src/core/instance/render.ts.
Where is initRender() defined?
initRender() is defined in src/core/instance/render.ts at line 21.
What does initRender() call?
initRender() calls 3 function(s): createElement, normalizeScopedSlots, resolveSlots.
What calls initRender()?
initRender() is called by 1 function(s): initMixin.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free