我正在尝试禁用我的ionic 5项目上的动画。在网上搜索时,我发现了一种方法,可以通过使用animated="禁用"来禁用它;false";离子路由器插座中。它确实禁用了动画,但当我尝试在生产中构建时,它会给我以下错误。
ionic capacitor build android --prod
Error: src/app/app.component.html:114:35 - error TS2322: Type 'string' is not assignable to type 'boolean'.
<ion-router-outlet id="content" animated="false" ></ion-router-outlet>
animated
是一个布尔属性,因此您必须使用属性绑定:
<ion-router-outlet id="content" [animated]="false"></ion-router-outlet>