<web-view ref="xxx" @onPostMessage="xxxxx"></web-view>
<html>
<script src="https://gitee.com/dcloud/uni-app/raw/dev/dist/uni.webview.1.5.4.js"></script>
<script>
document.addEventListener('UniAppJSBridgeReady', function() {
uni.postMessage({
data: {
action: 'message'
}
});
})
</script>
</html>
- 发布:2023-02-15 12:09
- 更新:2023-02-15 15:36
- 阅读:277
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 3.6.14
手机系统: Android
手机系统版本号: Android 12
手机厂商: 一加
手机机型: 8p
页面类型: nvue
vue版本: vue2
打包方式: 离线
项目创建方式: HBuilderX
示例代码:
操作步骤:
网页使用uni.postMessage会报Java exception was raised during method invocation
网页使用uni.postMessage会报Java exception was raised during method invocation
预期结果:
正常收到消息
正常收到消息
实际结果:
会报错Java exception was raised during method invocation
会报错Java exception was raised during method invocation
bug描述:
Android Nvue 使用webview, 网页使用uni.postMessage会报Java exception was raised during method invocation
1 个回复
DCloud_Android_ST
使用HX3.6.18版本试下