【问题标题】:Is it possible to animate dom reorderings with framer motion是否可以使用成帧器运动为 dom 重新排序设置动画
【发布时间】:2020-08-24 14:59:14
【问题描述】:

如何使用成帧器运动为 dom 重新排序设置动画(或过渡)?我读过一种叫做 FLIP 的技术(提到了here,但我不确定如何将它实现到成帧器运动中。

【问题讨论】:

    标签: reactjs framer-motion


    【解决方案1】:

    您可以通过将layout 道具添加到您的运动组件来实现。确保您使用的是 framer-motion 2.0 及更高版本,因为在此之前它曾经是layoutTransition={transition object}

    在此处查看工作示例https://codesandbox.io/s/framer-motion-reorder-animation-forked-4jbqh?file=/src/Example.tsx

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-22
      • 2012-01-22
      • 1970-01-01
      • 1970-01-01
      • 2021-07-05
      • 1970-01-01
      • 2021-08-15
      相关资源
      最近更新 更多