Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
leaveActiveClass = `${name}-leave-active`,
leaveToClass = `${name}-leave-to`,
...baseProps
}: TransitionProps): BaseTransitionProps {
if (!css) {
return baseProps
}
const instance = getCurrentInstance()!
const durations = normalizeDuration(duration)
const enterDuration = durations && durations[0]
const leaveDuration = durations && durations[1]
const { appear, onBeforeEnter, onEnter, onLeave } = baseProps
// is appearing
if (appear && !getCurrentInstance()!.isMounted) {
enterFromClass = appearFromClass
enterActiveClass = appearActiveClass
enterToClass = appearToClass
}
type Hook = (el: HTMLElement, done?: () => void) => void
const finishEnter: Hook = (el, done) => {
removeTransitionClass(el, enterToClass)
removeTransitionClass(el, enterActiveClass)
done && done()
}
const finishLeave: Hook = (el, done) => {
removeTransitionClass(el, leaveToClass)
removeTransitionClass(el, leaveActiveClass)