当前位置:网站首页>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 表示禁止默认返回
},
边栏推荐
- 学习笔记(7)Funtion
- Conditional constructor ~wapper
- Control 'ContentPlaceHolder1_ddlDepartment' of type 'DropDownList' must be placed inside a form tag with runat=server.
- MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
- flutter 参数传一个范型数据
- Please tell me, how to write Flink SQL and JDBC sink into mysql library and want to create an auto-incrementing primary key
- pnpm + workspace + changesets 构建你的 monorepo 工程
- 五款优秀免费的在线抠图工具
- OC-error prompt
- MySQL - Index Optimization and Query Optimization
猜你喜欢
随机推荐
View port number occupancy
MySQL-Multiversion Concurrency Control
MySQL事务(transaction) (有这篇就足够了..)
Fatal error compiling: 无效的目标发行版: 11
Mysql报错2003 解决办法 Can‘t connect to MySQL server on ‘localhost‘ (10061)
HCIP 第十一天
[Unity3D] Beginner Encryption Skills (Anti-Cracking)
flutter 自己写一个组件
(2022 Niu Ke Duo School 5) D-Birds in the tree (tree DP)
五款优秀免费的在线抠图工具
静态路由综合实验
MySQL - Index Optimization and Query Optimization
Agile, DevOps and Embedded Systems Testing
数据中台:始于阿里,兴于DaaS
MySQL database design specification
LeetCode 2312. Sell Wood Blocks
OC-NSDictionary
Postgres horizontal table, automatically create partitions, table by time
Appium swipe problem
spark read folder data