如何禁用角形材质中的动画 [英] How to disable animations in angular material

查看:72
本文介绍了如何禁用角形材质中的动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了角形材料版本:5.2.1

I have used angular material version: 5.2.1

并且想知道如何禁用其动画, 尤其是matDialog.

And wanted to know how to disable their animations, especially the matDialog.

我尝试了@ .disabled,但是没有运气.

I have tried @.disabled but no luck.

推荐答案

您可以通过棱角材质使用NoopAnimationsModule

You can use NoopAnimationsModule by angular material

import {NoopAnimationsModule} from '@angular/platform-browser/animations';

@NgModule({
  ...
  imports: [NoopAnimationsModule],
  ...
})
export class PizzaPartyAppModule { }

或者,如果您想删除某些特定组件上的过渡,则可以通过CSS这样操作

Or if you want to remove transition on some specific components you can do it via CSS like this

.mat-dialog{ transition: none; }

这篇关于如何禁用角形材质中的动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆