Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何检查 MatSidenav 组件是否完成了关闭动画?我正在查看文档,但我只能看到一个 closedStart 事件。是否有一些解决方法或我想要做的事情?
我意识到我可以使用打开或关闭动画完全完成时触发的 opensChange 事件。
由于动画持续时间为 0.5 秒,您可以存储它开始关闭的时间,并随时知道动画是否完成:
let finished = (Date.now() - timeStarted) > 500;