如何为 Angular Material 2 对话框设置动画? [英] How can I animate Angular Material 2 dialog?
问题描述
如何为 Angular Material 2 对话框设置动画?
How can I animate Angular Material 2 dialog?
我尝试使用普通的 Angular 2+ 动画理论.它可以工作,但会发生什么是对话框上的元素被动画化(如预期),而对话框只是保持不变.但我想要的是对话框本身应该有动画效果,例如,不透明度应该在几秒钟内从 1 变为 0.
I tried using the normal Angular 2+ animation theory. it works, but what happens is the elements on the dialog get animated (as expected), and the dialog simply stays. But what I want is the dialog itself should animate, for example, the opacity should go from 1 to 0 in a couple of seconds.
我还检查了 MdDialog.close()
方法是否有任何动画选项,但似乎什么都没有.
I also checked whether the MdDialog.close()
method has any options to animate, but there seems nothing.
将对话框的不透明度从 1 设置为 0(例如在关闭它之前)是一个常见用例,我如何使用 Angular Material 2 对话框实现它?
Animating the opacity of a dialog from 1 to 0 (before closing it for example) is a common use case, how can I achieve it with Angular Material 2 dialog?
推荐答案
此功能尚不可用.您可以在此处跟踪状态.
This feature is not available yet. You can track the status here.
这篇关于如何为 Angular Material 2 对话框设置动画?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!