gpt4 book ai didi

Angular 动画在 IE edge 中不起作用

转载 作者:太空狗 更新时间:2023-10-29 17:05:14 24 4
gpt4 key购买 nike

我在 Angular 中为我的组件添加了一个动画。然而,动画在 Chrome 和 Firefox 中运行良好,但在 IE Edge 中,虽然样式在状态更改时正确应用,但没有指定动画,但动画不会触发。

有没有人遇到同样的问题?

这是我的代码:

animations: [
trigger('rowState', [
state('collapsed', style({
'height': 0,
'overflow-y': 'hidden'
})),
state('expanded', style({
'height': '*',
'overflow-y': 'hidden'
})),
transition('collapsed <=> expanded', [animate('1000ms ease-out')])
])
]

提前致谢

最佳答案

edge 不支持 Web 动画, 你应该添加 polyfill

Angular animations are built on top of the standard Web Animations API and run natively on browsers that support it. For other browsers, a polyfill is required. Grab web-animations.min.js from GitHub and add it to your page.

关于 Angular 动画在 IE edge 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44612735/

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