当前位置:网站首页>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 表示禁止默认返回
},
边栏推荐
- Control 'ContentPlaceHolder1_ddlDepartment' of type 'DropDownList' must be placed inside a form tag with runat=server.
- flutter 参数传一个范型数据
- 研发过程中的文档管理与工具
- FormData upload binary file, object, object array
- 数据中台:始于阿里,兴于DaaS
- MySQL-索引详解
- [mixed] PIP in domestic source tutorial and domestic source address
- redis-advanced
- PLSQL Developer安装和配置
- MySQL批量更新
猜你喜欢

MGRE综合实验

(2022 Niu Ke Duo School 5) D-Birds in the tree (tree DP)

Compact格式下MySQL的数据如何存储到磁盘

Comprehensive experiment of MPLS and BGP

Introduction to mysql operation (4) ----- data sorting (ascending, descending, multi-field sorting)

牛客2022 暑期多校4 D Jobs (Easy Version)(递推优化策略)

HCIP 第四天

MySQL-底层设置

替换ptmalloc,使用tcmalloc和jemalloc

pnpm + workspace + changesets 构建你的 monorepo 工程
随机推荐
pnpm install出现:ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
MySQL-执行流程+缓存+存储引擎
HCIP 第六天
MySQL batch update
MySQL - index explanation
I.MX6U-ALPHA开发板(EPIT定时器实验)
HCIP 第十三天
How to export multiple query results at once in SQL server 2014?
MySQL-Execution Process + Cache + Storage Engine
View port number occupancy
MySQL报错1055解决办法:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
【CV】OpenVINO installation tutorial
spark读取文件夹数据
spark 读取本地文件
数据中台:始于阿里,兴于DaaS
FormData upload binary file, object, object array
DeadLock的可视化分析
论文理解:“Cross-Scale Residual Network: A GeneralFramework for Image Super-Resolution,Denoising, and “
Fatal error compiling: 无效的目标发行版: 11
【Unity3D】初学加密技巧(反破解)