当前位置:网站首页>uniapp 禁止默认返回事件
uniapp 禁止默认返回事件
2022-08-02 07:26:00 【LifeOases】
使用 onBackPress 方法,可以监听返回事件,通过设置 阻止默认返回事件, 编写自己的返回页面
注:
在该函数中返回值为 true 时,才表示不执行默认的返回,自行处理此时的业务逻辑。
H5平台,顶部导航栏返回按钮支持 onBackPress(),浏览器默认返回按键及Android手机实体返回键不支持
onBackPress() 暂不支持直接在自定义组件中配置该函数,目前只能是在页面中来处理。
onBackPress(e) {
// 这里可以自定义返回逻辑
uni.switchTab({
url: '/pages/tabBar/index/index'
});
return true // return true 表示禁止默认返回
},
边栏推荐
- (2022 Niu Ke Duo School 5) D-Birds in the tree (tree DP)
- MySQL批量更新
- HCIP 第十一天
- The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
- flutter在导航栏处实现对两个列表的点击事件
- Kind of weird!Access the destination URL, the host can container but not
- pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
- 有点奇怪!访问目的网址,主机能容器却不行
- OSPF 综合实验
- Inverter insulation detection detection function and software implementation
猜你喜欢
MySQL报错1055解决办法:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
HCIP 第五天
2022-08-01 第四小组 修身课 学习笔记(every day)
Mysql error 2003 solution Can 't connect to Mysql server on' localhost '(10061).
MySQL-FlinkCDC-Hudi enters the lake in real time
FormData upload binary file, object, object array
有点奇怪!访问目的网址,主机能容器却不行
The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
OC-error prompt
HCIP 第六天
随机推荐
如何保护智能家居不受黑客攻击
spark architecture
HCIP 第十二天
数据中台:始于阿里,兴于DaaS
LeetCode 2312. Sell Wood Blocks
Azure Synapse Analytics上创建用户并赋予权限
有点奇怪!访问目的网址,主机能容器却不行
metabase访问adb mysql 如何控制会话时区??
PLSQL Developer安装和配置
HCIP 第六天
Visual Analysis of DeadLock
HCIP 第十一天
OC-error prompt
Appium swipe problem
替换ptmalloc,使用tcmalloc和jemalloc
I.MX6U-ALPHA开发板(EPIT定时器实验)
HCIP第二天
Appium 滑动问题
postgres groupby merge strings
关于DDoS的几个误区