useTransition
Transition between values
Package: @vueuse/core
Category: Animation
Usage
import { TransitionPresets, useTransition } from '@vueuse/core'
import { shallowRef } from 'vue'
const source = shallowRef(0)
const output = useTransition(source, {
duration: 1000,
easing: TransitionPresets.easeInOutCubic,
})Options
| Option | Type | Default | Description |
|---|---|---|---|
| delay | MaybeRef<number> |
- | Milliseconds to wait before starting transition |
| disabled | MaybeRef<boolean> |
- | Disables the transition |
| onFinished | () => void |
- | Callback to execute after transition finishes |
| onStarted | () => void |
- | Callback to execute after transition starts |