【问题标题】:How to disable mat-spinner out animation如何禁用垫旋转动画
【发布时间】:2019-05-13 12:15:19
【问题描述】:

我实现的 Angular Material 微调器有一个动画,使它在消失之前下降。有没有办法让这个动画失效? 这是代码:我尝试了关键帧,但它不起作用。

<mat-spinner style="margin: auto; margin-top: 10%"></mat-spinner>

  @keyframes slideDown {
    0% {}
    100% {
        transform: translateY(20%);
    }
}

.cdk-overlay-pane {
    transform: translateY(-250%);
    animation: slideDown 0.5s forwards 0s ease-in;
}

.cdk-overlay-container>* {
    transition: none;
}

【问题讨论】:

标签: angular typescript


【解决方案1】:

在你的 @NgModule 导入数组中添加“BrowserAnimationsModule”,如果有的话,删除 "NoopAnimationsModule"

@NgModule({
declarations: [..],
imports: [
    ..
    BrowserAnimationsModule,
    ..
]
})

【讨论】:

  • 我那里已经有了 BrowserAnimationsModule,也没有 NoopAnimationsModule。
  • @ScottTushy 请在问题中添加更多源代码。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-17
  • 2012-07-21
  • 2010-11-06
  • 2011-08-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多