调试中js出现:Error: ASSERT: _before() should be called while animating
app.component.html代码:
<ion-app>
<ion-menu menuId="first" side="start" >
<ion-content>
<ion-list>
<ion-item style="text-align:center;" lines="none">
<ion-label><img src="../../../assets/icon/navigation/my_data_plan.png"
style="width:64px;height:64px;" /></ion-label>
</ion-item>
<ion-item style="text-align:center;">
<ion-label>{{account}}
<span *ngIf="isLogined" (click)="logout()"> {{loginOut}}</span>
<span *ngIf="!isLogined" (click)="gotoLoginPage()">{{login}}</span>
</ion-label>
</ion-item>
<ion-menu-toggle auto-hide="false">
<ion-item *ngFor="let navItem of navList" (click)="gotoPages(navItem.url)">
<ion-avatar slot="start">
<img src="{{navItem.icon}}">
</ion-avatar>
<ion-label>{{navItem.title }}</ion-label>
</ion-item>
</ion-menu-toggle>
</ion-list>
</ion-content>
</ion-menu>
<ion-header>
<ion-toolbar color="primary">
<ion-buttons slot="end">
<ion-button>
<img src="../../../assets/icon/header/reset.png"
style="width:30px;height:30px;" />
</ion-button>
<ion-button>
<img src="../../../assets/icon/header/off.png"
style="width:30px;height:30px;" />
</ion-button>
<!-- <ion-button (click)="openMenu()" style="border:1px solid #fff;--color:#fff;">
</ion-button> -->
<ion-menu-button style="border:1px solid #fff;--color:#fff;"></ion-menu-button>
</ion-buttons>
<ion-title>Pokefi admin</ion-title>
</ion-toolbar>
</ion-header>
<ion-router-outlet main></ion-router-outlet>
</ion-app>
app.component.ts代码:
gotoPages(url: string) {
this.menu.close('first');
location.reload();
if (url === Routes.Settings) {
this.router.navigate([url])
} else if (url === Routes.Data_Plan_List || url === Routes.My_Data_Plans) {
this.router.navigateByUrl(url);
//this.router.navigate([this.isLogined ? url : Routes.User_Login])
} else {
if (this.isLogined) {
this.router.navigate([url])
} else {
this.toastService.popToast('no_permission_warning', Ion_Color.Dark)
this.router.navigate([Routes.User_Login])
}
}
}