initRender() — vue Function Reference
Architecture documentation for the initRender() function in render.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD e088d580_2e3e_9093_295c_70dc92327b67["initRender()"] 340c5746_ff29_c74c_9da5_50db2db76e5f["initMixin()"] 340c5746_ff29_c74c_9da5_50db2db76e5f -->|calls| e088d580_2e3e_9093_295c_70dc92327b67 456d8782_7a49_0d3e_9e64_31ae4ba7b534["resolveSlots()"] e088d580_2e3e_9093_295c_70dc92327b67 -->|calls| 456d8782_7a49_0d3e_9e64_31ae4ba7b534 7f59d675_8a0c_03b6_a7a6_985942631eb0["normalizeScopedSlots()"] e088d580_2e3e_9093_295c_70dc92327b67 -->|calls| 7f59d675_8a0c_03b6_a7a6_985942631eb0 451b8ba4_f373_c786_0c64_c3e7e51ce956["createElement()"] e088d580_2e3e_9093_295c_70dc92327b67 -->|calls| 451b8ba4_f373_c786_0c64_c3e7e51ce956 style e088d580_2e3e_9093_295c_70dc92327b67 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
Called By
Source
Frequently Asked Questions
What does initRender() do?
initRender() is a function in the vue codebase.
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