加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

如何使用Angular 4动画进入多个状态?

发布时间:2020-12-17 16:59:20 所属栏目:安全 来源:网络整理
导读:我正在使用Angular 4动画,我想知道从初始状态到最终状态的最佳方式是什么,通过其他状态. 如果我们以此为例( https://angular.io/guide/animations): animations: [ trigger('animationState',[ state('stateOne',style({ // some style })),state('stateTwo
我正在使用Angular 4动画,我想知道从初始状态到最终状态的最佳方式是什么,通过其他状态.
如果我们以此为例( https://angular.io/guide/animations):

animations: [
  trigger('animationState',[
    state('stateOne',style({
      // some style
    })),state('stateTwo',transition('inactive => active',animate('100ms ease-in')),transition('active => inactive',animate('100ms ease-out'))
  ])
]

所以问题是,如果我添加第三个和第四个状态并且我将活动状态从“stateOne”切换到“stateTwo”,那么如何定义转换以使其自动通过其他类似的状态:stateOne => stateThird => stateFourth => stateTwo.有没有办法定义转换,以便在没有任何变通方法的情况下拥有此行为?

解决方法

你可以使用角度键帧

https://angular.io/guide/animations#multi-step-animations-with-keyframes

我认为角度文档对此有最好的解释

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读