gpt4 book ai didi

angular - 如何使用 Angular 4 动画经历多个状态?

转载 作者:太空狗 更新时间:2023-10-29 18:01:18 25 4
gpt4 key购买 nike

我正在使用 Angular 4 动画,我想知道从初始状态到最终状态的最佳方式是什么,再经过其他状态。如果我们以此为例(https://angular.io/guide/animations):

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

所以问题是,如果我添加第三个和第四个状态并将事件状态从“stateOne”切换到“stateTwo”,如何定义转换以便它自动通过其他状态,如下所示: stateOne => stateThird => stateFourth => stateTwo。有没有一种方法可以定义一个转换来实现这种行为而无需任何变通办法?

最佳答案

您可以使用 Angular 的 keyframes() .也可以看看 Complex animation sequences .

关于angular - 如何使用 Angular 4 动画经历多个状态?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46936218/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com