Skip to content

Files

Latest commit

d1dba7c Β· Mar 28, 2021

History

History
34 lines (24 loc) Β· 780 Bytes

useTween.md

File metadata and controls

34 lines (24 loc) Β· 780 Bytes

useTween

Vue animation hook that tweens a number between 0 and 1.

Usage

import {useTween} from 'vue-next-use';

const Demo = {
  setup(){
      const t = useTween();

      return () => (
          <div>
              Tween: {t}
          </div>
      );
  }
};

Reference

useTween(easing?: string, ms?: number, delay?: number): number

Returns a number that begins with 0 and ends with 1 when animation ends.

  • easing β€” one of the valid easing names, defaults to inCirc.
  • ms β€” milliseconds for how long to keep re-rendering component, defaults to 200.
  • delay β€” delay in milliseconds after which to start re-rendering component, defaults to 0.