我通过以下方式升级到Angular 7.1.0:
"@angular/animations": "^7.1.0",
"@angular/cdk": "^7.1.0",
"@angular/common": "^7.1.0",
"@angular/compiler": "^7.1.0",
"@angular/core": "^7.1.0",
"@angular/forms": "^7.1.0",
"@angular/http": "^7.1.0",
"@angular/material": "^7.1.0",
"@angular/platform-browser": "^7.1.0",
"@angular/platform-browser-dynamic": "^7.1.0",
"@angular/router": "^7.1.0"
我正在使用Angular Material Expansion Panels,它们最初通过[expanded] =“ false”扩展为false。
扩展面板的主体在几毫秒内可见。从扩展到未扩展似乎只是一小段路程。 有人有同样的问题吗?
<mat-expansion-panel-header>
<mat-panel-title>
<div class="NumberAccordionContentWrapper__centered">
<h2 [class.NumberAccordion__notExpanded]="!isExpanded">{{ headline }}</h2>
</div>
</mat-panel-title>
</mat-expansion-panel-header>
<div class="NumberAccordionContentWrapper__centered">
<ng-template tbHost></ng-template>
</div>
答案 0 :(得分:3)
答案 1 :(得分:1)
此人发布了一个关于CSS的临时工作,该工作似乎可行: https://github.com/angular/components/issues/11765#issuecomment-447991348
::ng-deep .ng-animating div mat-accordion mat-expansion-panel mat-expansion-panel-header {
height: 48px;
}
::ng-deep .ng-animating div mat-accordion mat-expansion-panel div.mat-expansion-panel-content {
height: 0px;
visibility: hidden;
}
我放弃了:: ng-deep并将其添加到我的全局样式中。