feat: 侧滑返回
This commit is contained in:
@@ -544,6 +544,17 @@ export default {
|
||||
isSplash: false,
|
||||
};
|
||||
},
|
||||
onBackPress(options) {
|
||||
console.log("我是侧滑",options)
|
||||
// #ifdef APP-PLUS
|
||||
if (options.from === 'backbutton' && this.isSplash) {
|
||||
// 1. 阻止默认 pop
|
||||
plus.webview.currentWebview().canBack = false // 关键句
|
||||
uni.reLaunch({ url: '/pages/home/home' }) // 举例:回首页
|
||||
return true // 返回 true 即“我处理过了”
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
onLoad(options) {
|
||||
const id = options.id;
|
||||
const source = options.source;
|
||||
@@ -577,6 +588,7 @@ export default {
|
||||
this
|
||||
);
|
||||
},
|
||||
|
||||
onHide() {
|
||||
timer && clearTimeout(timer);
|
||||
timer = null;
|
||||
|
||||
Reference in New Issue
Block a user