Solve the error reported by uni-app+vue3+vite web-view using uni.webView.postMessage()

report error

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

solve

It's very pitfall, the official document doesn't explain it, and the examples written in related posts are too old, you should install @dcloudio/uni-webview-jsthe package , and then import "@dcloudio/uni-webview-js"you can use it normally

Guess you like

Origin blog.csdn.net/qq1014156094/article/details/130422580