2***@qq.com
2***@qq.com
  • 发布:2021-12-27 10:19
  • 更新:2021-12-27 10:19
  • 阅读:385

uniapp web-view uni.postMessage网络页面无法拿到值

分类:uni-app

<script type="text/javascript" src="https://js.cdn.aliyun.dcloud.net.cn/dev/uni-app/uni.webview.1.5.2.js"></script>
<script type="text/javascript">
document.addEventListener('UniAppJSBridgeReady', function() {
uni.postMessage({
data: {
action: 'postMessage'
}
});

        uni.navigateBack({  
          delta:10  
        });  

    })  
</script>  

我在本地html页面里面这样写,在unapp vue页面可以通过<web-view src="/hybrid/html/local.html" @message="getMessage" ></web-view>
getMessage(e) {
console.log("@message",JSON.stringify(e.detail))
}

这个拿到传过来的值,但是,我现在的项目,html这个页面是后端用Php直接写好了传过来的,然后我这边就拿不到值了,这个是怎么回事啊?

2021-12-27 10:19 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复