ionic4.x ion-menu制作侧面菜单,页面多次跳转之后无法打开,出现了动画异常,求解?

调试中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()"> &nbsp; {{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])
      }
    }
  }
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问