Home / Function/ whenTransitionEnds() — vue Function Reference

whenTransitionEnds() — vue Function Reference

Architecture documentation for the whenTransitionEnds() function in transition-util.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  88c9bcbe_8cab_8911_ad5d_6a848e3ff126["whenTransitionEnds()"]
  b003e13b_30f4_2501_b631_df864fa7941b["enter()"]
  b003e13b_30f4_2501_b631_df864fa7941b -->|calls| 88c9bcbe_8cab_8911_ad5d_6a848e3ff126
  29af0f73_d62b_5291_e707_1f3301bf3357["leave()"]
  29af0f73_d62b_5291_e707_1f3301bf3357 -->|calls| 88c9bcbe_8cab_8911_ad5d_6a848e3ff126
  1fc2e044_c7b6_1a3e_78f8_060e569094c2["getTransitionInfo()"]
  88c9bcbe_8cab_8911_ad5d_6a848e3ff126 -->|calls| 1fc2e044_c7b6_1a3e_78f8_060e569094c2
  style 88c9bcbe_8cab_8911_ad5d_6a848e3ff126 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/transition-util.ts lines 92–119

export function whenTransitionEnds(
  el: Element,
  expectedType: string | undefined,
  cb: Function
) {
  const { type, timeout, propCount } = getTransitionInfo(el, expectedType)
  if (!type) return cb()
  const event: string =
    type === TRANSITION ? transitionEndEvent : animationEndEvent
  let ended = 0
  const end = () => {
    el.removeEventListener(event, onEnd)
    cb()
  }
  const onEnd = e => {
    if (e.target === el) {
      if (++ended >= propCount) {
        end()
      }
    }
  }
  setTimeout(() => {
    if (ended < propCount) {
      end()
    }
  }, timeout + 1)
  el.addEventListener(event, onEnd)
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does whenTransitionEnds() do?
whenTransitionEnds() is a function in the vue codebase.
What does whenTransitionEnds() call?
whenTransitionEnds() calls 1 function(s): getTransitionInfo.
What calls whenTransitionEnds()?
whenTransitionEnds() is called by 2 function(s): enter, leave.

Analyze Your Own Codebase

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

Try Supermodel Free