简体   繁体   English

如何在 Ionic 4 cordova 上制作退出按钮

[英]How to make a exit button on Ionic 4 cordova

I have tried to create a button to exit, and none of them works.我试图创建一个退出按钮,但它们都不起作用。 What would be the correct way to do it on Ionic 4 with Cordova?使用 Cordova 在 Ionic 4 上执行此操作的正确方法是什么?

Thanks谢谢

尝试使用navigator['app'].exitApp() .. 或者如果您愿意使用cordova cordova.plugins.exit()

just providing an example ... even though the app "exit" - when clicking on the background tasks - i still see it .. :/只是提供一个例子......即使应用程序“退出” - 单击后台任务时 - 我仍然看到它......:/

  # home.page.html
  <ion-button (click)="exitApp()" color="danger">
    Exit App
  </ion-button>

  # home.page.ts
  exitApp() {
    navigator['app'].exitApp();
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM