安装物理返回按键插件:
cordova plugin add cordova-plugin-backbutton
index.html中添加:
<div id='exit' style="display: none;"></div>
在main.js中修改添加如下内容,监听物理返回按键:
document.addEventListener('deviceready', function () {
let vueInstance = new Vue(
{
el: '#app',
router,
store,
components: {
App},
template: '<App/>'
});
let time;
//监听手机返回按键
document.addEventListener("backbutton", function () {
let intervalTime = new