获得过 0 次赞
回答过的问题获得 0 次赞
分享过的文章/案例获得 0 次赞
评论与回复获得 0 次赞
开发者工具中没有问题,但是真机验证有问题
h5页面可以postMessage,但是小程序用@message并没有触发对应的函数?// h5页面,在小程序会打印信息 function handleSharePageStatus() { const data = { url: location.href, title: 'xxxx', link: location.href, desc: 'xxxx' } console.log('---------', data) window.wx.miniProgram && window.wx.miniProgram.postMessage({ type: 'share', data: data }) } // 小程序,在开发者工具会触发@message,但是真机验证就是不触发 <template> <web-view :src="webUrl" @message="handleViewMessage" /> </template>
2024-07-19