First of all, let me explain why I write this essay;
Because we write the WebApp, on the Android phone, press the fallback button, will quit the app, go back to the desktop, and not like the native app, there will be a hint, for example, "Press again to quit the app" this hint,
Press the return button once to go back to the desktop, which is obviously not what we want, nonsense ends, the following code;
Mui.init ({keyeventbind: {backbutton:true//Close Back button listener});//////////// processing logic: Within 1 seconds, press the return key twice, then exit the application; var first = Null;mui.back = function () {//First button, prompt ' press again to exit Apply ' if (!first) {first = new Date (). GetTime (); Press again to exit the application ');//Give Hint History.go (-1)//fallback to previous page settimeout (function () {//1s after first = null;}, 1000);} else {if (New Date (). GetTime ()-First < 1000) {//If two times the pressed time is less than 1s,plus.runtime.quit ();//Then quit the app
} } };
As long as you add this code to the index.html, you can implement it.
|--------------------------------------Forget
|-----------------------------------------.
|--------------------------------------------A
|-----------------------------------------------pieces
|---------------------------------------------------Things
We also have to introduce a JS file, or Mui.init, will be reported MUI can not find the error
<script type= ' text/javascript ' src= './static/mui.min.js ' ></script>
That's all, No.
Oh, again Friday, tomorrow can sleep late, happy
Using Vue to develop WebApp, an Android phone comes with a fallback key to solve problems