当前位置:网站首页>Wechat applet, get the current page and judge whether the current page is a tabbar page
Wechat applet, get the current page and judge whether the current page is a tabbar page
2022-06-10 18:29:00 【Sit and wait for the sunset time】
principle : use getCurrentPages() Method , Get all the pages visited by the user , The last page is the current page

Then there is route attribute , You will know the path of the current page , And again tabbar Just compare the path of the page
let pages = getCurrentPages()
console.log(pages)
if(pages.length > 0) {
let prevPage = pages[pages.length - 1]
if (prevPage.route === 'pages/index/index' || prevPage.route === 'pages/chat/chat') {
uni.showModal({
title: ' Tips ',
content: ' This is a tabbar page ',
showCancel: false,
success: (res) => {
if(res.confirm) {
}
}
});
}
}边栏推荐
猜你喜欢
随机推荐
【QNX Hypervisor 2.2 用户手册】3.2.1 VM配置语法
基于注解和反射生成xml
Domestic cosmetics, lost 618
IBOX系统开发核心功能和部分核心源码
智慧城市网络安全建设框架及实践
商业智能BI的服务对象,企业管理者的管理“欲望”该如何实现?
换根呀呀啊呀
基础提升---树形DP补充
uniapp uview 框架的form表单,输入校验手机号、校验微信号
两部门发文明确校外培训机构消防安全条件
Faster Planner——Kinodynamic Astar详解
美学心得(第二百三十七集) 罗国正
[technical analysis] discuss the production process and technology of big world games - preliminary process
mysql备份和shell脚本手动执行没问题,crontab定时执行失败
XML & XPath parsing
Huawei cloud Kunpeng devkit code migration practice
Wireshark学习笔记(一)常用功能案例和技巧
攻防演练 | 网络安全“吹哨人”:安全监控
【存储】下一代分布式文件系统 研究
Summary of all contents of cloud computing setup to ensure that a complete cloud computing server can be built, including node installation, instance allocation, network configuration, etc









