在IOS端使用onBackPress事件阻止不了系统返回上一页事件,在安卓端onBackPress事件是有效的,IOS端怎么阻止回退事件呢

1***@qq.com
- 发布:2024-01-31 18:55
- 更新:2025-05-30 15:31
- 阅读:456

喜欢技术的前端 - QQ---445849201
可以禁止 onBackPress return true; 需要禁止侧滑事件
onBackPress(options){
return true;
},
onLoad() {
//uniapp单页面禁止侧滑返回(VUE)
// #ifdef APP-PLUS
let currentWebview = this.$mp.page.$getAppWebview() //获取当前页面的webview对象
currentWebview.setStyle({ popGesture: 'none' })
// #endif
},
2***@qq.com
没有效果呀
2025-06-03 10:47