uni-app webView返回到原生App

onMessage (event) {

let pages = getCurrentPages()

let page = pages[pages.length - 1];

let currentPages = page.$getAppWebview()

let children = currentPages.children()

// uni.navigateBack()

if (children.length === 0) {

uni.navigateBack()

} else {

children[0].close()

setTimeout(() => {

uni.navigateBack()

}, 80)

}

console.log('web-view的---ai----:', event)

return true;

}

相关推荐
遗憾随她而去.1 小时前
uniapp 折叠动画 <transition> 踩坑记录
css·uni-app
百锦再7 小时前
Elements Plus 跨设备自适应显示问题综合解决方案
python·flutter·小程序·uni-app·k8s·tornado·net
坚持学习前端日记10 小时前
UniApp APK打包与Android深度集成能力解析
android·vue.js·uni-app
wetyuo1 天前
【随手记】uniapp + V3 使用TailwindCss3
uni-app·vue·css3·vite
小恒恒3 天前
2025 Vibe Coding 有感
前端·uni-app·trae
一颗小青松3 天前
uniapp使用uni-im
uni-app
2501_916007473 天前
iPhone APP 性能测试怎么做,除了Instruments还有什么工具?
android·ios·小程序·https·uni-app·iphone·webview
2501_915106323 天前
Windows 环境下有哪些可用的 iOS 上架工具, iOS 上架工具的使用方式
android·ios·小程序·https·uni-app·iphone·webview
一颗小青松3 天前
uniapp vue3中app端使用腾讯云点播上传
uni-app·云计算·腾讯云
玄尺_0073 天前
uniapp h5端使浏览器弹出下载框
前端·javascript·uni-app