单页面,返回的是上一个打开页面,而不是他们整体跳出这个页面。需要代码
//初始化单页view
var viewApi = mui('#app').view({
defaultPage: '#setting'
});
var view = viewApi.view;
(function($) {
//处理view的后退与webview后退
var oldBack = $.back;
$.back = function() {
if (viewApi.canBack()) { //如果view可以后退,则执行view的后退
viewApi.back();
} else { //执行webview后退
oldBack();
}
};
})(mui);
//初始化单页view
var viewApi = mui('#app').view({
defaultPage: '#setting'
});
var view = viewApi.view;
(function($) {
//处理view的后退与webview后退
var oldBack = $.back;
$.back = function() {
if (viewApi.canBack()) { //如果view可以后退,则执行view的后退
viewApi.back();
} else { //执行webview后退
oldBack();
}
};
})(mui);