当前位置:网站首页>mui 关闭其他页面,只保留首页面
mui 关闭其他页面,只保留首页面
2022-04-23 13:04:00 【孤身不觉晚】
这个可以用于mui打开很多子页面时,直接返回首页面…
var wvs = plus.webview.all(); //所有窗口对象
var launch = plus.webview.getLaunchWebview(); //首页窗口对象
var self = plus.webview.currentWebview(); //当前窗口对象
var appid = plus.webview.getLaunchWebview().id //首页窗口id
for(var i = 0, len = wvs.length; i < len; i++) {
// 首页以及当前窗口对象,不关闭;
if(wvs[i].id == appid || wvs[i].id == 'nav_footer.html' || wvs[i].id == 'index.html' || wvs[i].id == 'check_content.html' || wvs[i].id == 'my.html' || wvs[i].id == 'HBuilder') {
//选定某一页不关wvs[i].id === localStorage.homeWebId
continue;
} else {
wvs[i].close('none'); //关闭中间的窗口对象,为防止闪屏,不使用动画效果;
}
} // 此时,窗口对象只剩下首页以及当前窗口,直接关闭当前窗口即可;
版权声明
本文为[孤身不觉晚]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_40043424/article/details/102851563
边栏推荐
- melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
- Custom nail robot alarm
- Pytorch: a pit about the implementation of gradreverselayer
- SSM framework series - annotation development day2-2
- 98. Error s.e.errormvcautoconfiguration $staticview reported by freemaker framework: cannot render error page for request
- The continuous construction of the Internet industry platform is not only able to collect traffic
- AUTOSAR from introduction to mastery 100 lectures (81) - FIM of AUTOSAR Foundation
- Process virtual address space partition
- Hanlp word splitter (via spark)
- Date time type in database
猜你喜欢
AUTOSAR from introduction to mastery 100 lectures (51) - AUTOSAR network management
Process virtual address space partition
8 websites that should be known for product development to enhance work experience
Recovering data with MySQL binlog
melt reshape decast 长数据短数据 长短转化 数据清洗 行列转化
Record Alibaba cloud server mining program processing
100 GIS practical application cases (53) - making three-dimensional image map as the base map of urban spatial pattern analysis
在线计算过往日期天数,计算活了多少天
Homomorphic encryption technology learning
100 lectures on practical application cases of Excel (VIII) - report connection function of Excel
随机推荐
AUTOSAR from introduction to mastery 100 lectures (51) - AUTOSAR network management
Packet capturing and sorting -- TCP protocol [8]
(personal) sorting out system vulnerabilities after recent project development
Summary of JVM knowledge points - continuously updated
SQL exercise question 1
Go language slicing operation
Wonderful review | the sixth issue of "source" - open source economy and industrial investment
Melt reshape decast long data short data length conversion data cleaning row column conversion
AUTOSAR from introduction to mastery 100 lectures (83) - bootloader self refresh
Read the data in Presto through sparksql and save it to Clickhouse
R语言中dcast 和 melt的使用 简单易懂
Recommended website for drawing result map
SSM framework series - data source configuration day2-1
AUTOSAR from introduction to mastery 100 lectures (50) - AUTOSAR memory management series - ECU abstraction layer and MCAL layer
内核错误: No rule to make target ‘debian/canonical-certs.pem‘, needed by ‘certs/x509_certificate_list‘
SSM框架系列——注解开发day2-2
Software testing weekly (issue 68): the best way to solve difficult problems is to wait and see the changes and push the boat with the current.
SSM framework series - JUnit unit test optimization day2-3
Huawei cloud MVP email
Use compressorjs to compress pictures, optimize functions, and compress pictures in all formats