//重写返回按钮
    ionViewDidLoad() {
        this.navBar.backButtonClick = this.backButtonClick;
    }
//清除除根栈外的其他栈
    backButtonClick = (e: UIEvent) => {
        // do something
        this.navCtrl.popToRoot();
    }

ionic4的话 参考这篇文章

https://blog.csdn.net/qq_21197023/article/details/88668745

发表评论