default.render() — vue Function Reference
Architecture documentation for the default.render() function in keep-alive.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD ebbea0b2_1829_e2c7_7530_51de4baf7e88["default.render()"] 32dec3ba_5f13_889d_402b_b05c09293bcd["_getComponentName()"] ebbea0b2_1829_e2c7_7530_51de4baf7e88 -->|calls| 32dec3ba_5f13_889d_402b_b05c09293bcd b900aa1d_e4c9_7752_d919_7e52ac95b173["matches()"] ebbea0b2_1829_e2c7_7530_51de4baf7e88 -->|calls| b900aa1d_e4c9_7752_d919_7e52ac95b173 47c14f28_c1ca_52d4_cc59_404156ff9d1e["remove()"] ebbea0b2_1829_e2c7_7530_51de4baf7e88 -->|calls| 47c14f28_c1ca_52d4_cc59_404156ff9d1e style ebbea0b2_1829_e2c7_7530_51de4baf7e88 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/core/components/keep-alive.ts lines 130–170
render() {
const slot = this.$slots.default
const vnode = getFirstComponentChild(slot)
const componentOptions = vnode && vnode.componentOptions
if (componentOptions) {
// check pattern
const name = _getComponentName(componentOptions)
const { include, exclude } = this
if (
// not included
(include && (!name || !matches(include, name))) ||
// excluded
(exclude && name && matches(exclude, name))
) {
return vnode
}
const { cache, keys } = this
const key =
vnode.key == null
? // same constructor may get registered as different local components
// so cid alone is not enough (#3269)
componentOptions.Ctor.cid +
(componentOptions.tag ? `::${componentOptions.tag}` : '')
: vnode.key
if (cache[key]) {
vnode.componentInstance = cache[key].componentInstance
// make current key freshest
remove(keys, key)
keys.push(key)
} else {
// delay setting the cache until update
this.vnodeToCache = vnode
this.keyToCache = key
}
// @ts-expect-error can vnode.data can be undefined
vnode.data.keepAlive = true
}
return vnode || (slot && slot[0])
}
Domain
Subdomains
Source
Frequently Asked Questions
What does default.render() do?
default.render() is a function in the vue codebase.
What does default.render() call?
default.render() calls 3 function(s): _getComponentName, matches, remove.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free