当前位置:网站首页>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
边栏推荐
- Important knowledge of network layer (interview, reexamination, term end)
- Metalama简介4.使用Fabric操作项目或命名空间
- 22. Bracket generation
- 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.
- 7_Addmodule和基因加和法add 得到的细胞类型打分在空间上空转对比
- (个人)最近项目开发后存在的系统漏洞整理
- 「玩转Lighthouse」轻量应用服务器自建DNS解析服务器
- decast id.var measure.var数据拆分与合并
- Design of STM32 multi-channel temperature measurement wireless transmission alarm system (industrial timing temperature measurement / engine room temperature timing detection, etc.)
- Process virtual address space partition
猜你喜欢

Important knowledge of transport layer (interview, retest, final)

Melt reshape decast long data short data length conversion data cleaning row column conversion
![[untitled] PID control TT encoder motor](/img/ce/942a0b87994699f73da215e7cad2a1.png)
[untitled] PID control TT encoder motor

有趣的IDEA插件推荐,给你的开发工作增添色彩

Free and open source charging pile Internet of things cloud platform

The project file '' has been renamed or is no longer in the solution, and the source control provider associated with the solution could not be found - two engineering problems

About the 'enum' enumeration type and structure.

8 websites that should be known for product development to enhance work experience

Van uploader upload picture implementation process, using native input to upload pictures

R语言中dcast 和 melt的使用 简单易懂
随机推荐
Go language slicing operation
4.22学习记录(你一天只做了水题是吗)
STD:: shared of smart pointer_ ptr、std::unique_ ptr
Customize classloader and implement hot deployment - use loadclass
7_ The cell type scores obtained by addmodule and gene addition method are compared in space
Idea的src子文件下无法创建servlet
SSM框架系列——Junit单元测试优化day2-3
22. 括号生成
产品开发都应该知道的8个网站,增强工作体验
Record the problems encountered in using v-print
5 free audio material websites, recommended collection
Subscribe to Alibaba demo send business messages
About the 'enum' enumeration type and structure.
Softbank vision fund entered the Web3 security industry and led a new round of investment of US $60 million in certik
CGC: contractual graph clustering for community detection and tracking
21 天学习MongoDB笔记
Install nngraph
Design and manufacture of 51 single chip microcomputer solar charging treasure with low voltage alarm (complete code data)
SSM框架系列——数据源配置day2-1
8086 of x86 architecture