解决 uni-app+vue3+vite web-view 使用 uni.webView.postMessage() 报错

报错

undefined is not an object (evaluating ‘uni.webbView.postMessage’)
或者
cant’t find xxx

解决

很坑,官方文档没有说明,并且相关帖子写的示例也太旧了,应该安装 @dcloudio/uni-webview-js 包,然后 import "@dcloudio/uni-webview-js" 才能正常使用

猜你喜欢

转载自blog.csdn.net/qq1014156094/article/details/130422580