to

将目标值从当前值动画变换指定值。
必须定义在本地补间参数 Object(对象)内部。

必需

仅当未定义 from 属性时有效

接受

默认值

如果仅定义了 from 属性,则使用当前目标值

to 代码示例

import { animate } from 'animejs';

animate('.square', {
  x: {
    to: '16rem', // From 0px to 16rem
    ease: 'outCubic',
  },
  rotate: {
    to: '.75turn', // From 0turn to .75turn
    ease: 'inOutQuad'
  },
});
<div class="large row">
  <div class="square"></div>
</div>