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

default.render() — vue Function Reference

Architecture documentation for the default.render() function in transition-group.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  02c9b9f3_efb3_aff8_a7ef_efc398c89bbd["default.render()"]
  1b7a090e_3310_f52f_ba36_fa6fc82b4a31["extractTransitionData()"]
  02c9b9f3_efb3_aff8_a7ef_efc398c89bbd -->|calls| 1b7a090e_3310_f52f_ba36_fa6fc82b4a31
  5b67b159_7ee7_ed13_42a0_e4b5c3befd84["getComponentName()"]
  02c9b9f3_efb3_aff8_a7ef_efc398c89bbd -->|calls| 5b67b159_7ee7_ed13_42a0_e4b5c3befd84
  style 02c9b9f3_efb3_aff8_a7ef_efc398c89bbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/components/transition-group.ts lines 58–102

  render(h: Function) {
    const tag: string = this.tag || this.$vnode.data.tag || 'span'
    const map: Record<string, any> = Object.create(null)
    const prevChildren: Array<VNode> = (this.prevChildren = this.children)
    const rawChildren: Array<VNode> = this.$slots.default || []
    const children: Array<VNode> = (this.children = [])
    const transitionData = extractTransitionData(this)

    for (let i = 0; i < rawChildren.length; i++) {
      const c: VNode = rawChildren[i]
      if (c.tag) {
        if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
          children.push(c)
          map[c.key] = c
          ;(c.data || (c.data = {})).transition = transitionData
        } else if (__DEV__) {
          const opts = c.componentOptions
          const name: string = opts
            ? getComponentName(opts.Ctor.options as any) || opts.tag || ''
            : c.tag
          warn(`<transition-group> children must be keyed: <${name}>`)
        }
      }
    }

    if (prevChildren) {
      const kept: Array<VNode> = []
      const removed: Array<VNode> = []
      for (let i = 0; i < prevChildren.length; i++) {
        const c: VNode = prevChildren[i]
        c.data!.transition = transitionData
        // @ts-expect-error .getBoundingClientRect is not typed in Node
        c.data!.pos = c.elm.getBoundingClientRect()
        if (map[c.key!]) {
          kept.push(c)
        } else {
          removed.push(c)
        }
      }
      this.kept = h(tag, null, kept)
      this.removed = removed
    }

    return h(tag, null, children)
  },

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 2 function(s): extractTransitionData, getComponentName.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free