首屏component.ts文件中使用
setupBrowserBackButtonBehavior() {
// Register browser back button action(s) window.onpopstate = (evt) => { // Close menu if open // Close any active modals or overlays let activePortal = this.ionicApp._loadingPortal.getActive() || this.ionicApp._modalPortal.getActive() || this.ionicApp._toastPortal.getActive() || this.ionicApp._overlayPortal.getActive(); if (activePortal) { activePortal.dismiss(); return; } // Navigate back if (this.navCtrl.canGoBack()) { this.app.goBack(); }else { WeixinJSBridge.call('closeWindow'); } }; // Fake browser history on each view enter this.app.viewDidEnter.subscribe((app) => { history.pushState(null, null, ""); }); }

ionic3 浏览器端返回

 

相关文章:

  • 2021-06-02
  • 2021-11-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-23
  • 2021-12-15
  • 2022-03-12
  • 2022-02-21
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
相关资源
相似解决方案