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

default.updated() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f164e6dd_dffc_287f_fa89_b6b22e692756["default.updated()"]
  5da207be_c15b_b75c_a486_6bdb569d90ee["addTransitionClass()"]
  f164e6dd_dffc_287f_fa89_b6b22e692756 -->|calls| 5da207be_c15b_b75c_a486_6bdb569d90ee
  d0ac78d7_5041_1236_9a5b_88482b24b402["removeTransitionClass()"]
  f164e6dd_dffc_287f_fa89_b6b22e692756 -->|calls| d0ac78d7_5041_1236_9a5b_88482b24b402
  style f164e6dd_dffc_287f_fa89_b6b22e692756 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/components/transition-group.ts lines 104–143

  updated() {
    const children: Array<VNodeWithData> = this.prevChildren
    const moveClass: string = this.moveClass || (this.name || 'v') + '-move'
    if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
      return
    }

    // we divide the work into three loops to avoid mixing DOM reads and writes
    // in each iteration - which helps prevent layout thrashing.
    children.forEach(callPendingCbs)
    children.forEach(recordPosition)
    children.forEach(applyTranslation)

    // force reflow to put everything in position
    // assign to this to avoid being removed in tree-shaking
    // $flow-disable-line
    this._reflow = document.body.offsetHeight

    children.forEach((c: VNode) => {
      if (c.data!.moved) {
        const el: any = c.elm
        const s: any = el.style
        addTransitionClass(el, moveClass)
        s.transform = s.WebkitTransform = s.transitionDuration = ''
        el.addEventListener(
          transitionEndEvent,
          (el._moveCb = function cb(e) {
            if (e && e.target !== el) {
              return
            }
            if (!e || /transform$/.test(e.propertyName)) {
              el.removeEventListener(transitionEndEvent, cb)
              el._moveCb = null
              removeTransitionClass(el, moveClass)
            }
          })
        )
      }
    })
  },

Domain

Subdomains

Frequently Asked Questions

What does default.updated() do?
default.updated() is a function in the vue codebase.
What does default.updated() call?
default.updated() calls 2 function(s): addTransitionClass, removeTransitionClass.

Analyze Your Own Codebase

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

Try Supermodel Free