var currentWebview = this.$scope.$getAppWebview()不能使用,uni-app里vue页面直接使用plus.webview.currentWebview()无效

alchemist
- 发布:2022-08-09 10:48
- 更新:2023-12-26 15:00
- 阅读:3479

https://uniapp.dcloud.net.cn/api/window/window.html#getcurrentpages
var pages = getCurrentPages();
var page = pages[pages.length - 1];
// #ifdef APP-PLUS
var currentWebview = page.$getAppWebview();
console.log(currentWebview.id);//获得当前webview的id
console.log(currentWebview.isVisible());//查询当前webview是否可见
// #endif
alchemist (作者)
可以的,感谢
2022-08-09 14:24
l***@163.com
大佬,请问一下,为什么用了之后报page.$getAppWebview is not a function这个错?
2023-11-13 11:25
xzh
回复 l***@163.com: 这是app-vue的才可以用
2023-11-13 12:20