Home / Function/ default.render() — vue Function Reference

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
  acf640b6_3f9a_6df2_5652_115082ad42f3["default.render()"]
  4878963d_c74c_367d_8701_bb4503aa7bc4["_getComponentName()"]
  acf640b6_3f9a_6df2_5652_115082ad42f3 -->|calls| 4878963d_c74c_367d_8701_bb4503aa7bc4
  f53d1350_01c5_2199_8795_3199421f4009["matches()"]
  acf640b6_3f9a_6df2_5652_115082ad42f3 -->|calls| f53d1350_01c5_2199_8795_3199421f4009
  5670215c_12e8_f1ac_96f5_43fa02f28d30["remove()"]
  acf640b6_3f9a_6df2_5652_115082ad42f3 -->|calls| 5670215c_12e8_f1ac_96f5_43fa02f28d30
  style acf640b6_3f9a_6df2_5652_115082ad42f3 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

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