从vue跳到nuve怎么传递数据,官方的“nvueId 为 nvue 所在 webview 的 id”,这个id怎么获取,还没跳转,页面还没进栈啊,怎么有id?直接用地址?数据,onLoad获取不行,想用vuex也不支持,我该怎么办?

水沟小鱼
- 发布:2019-02-25 16:50
- 更新:2019-08-12 17:04
- 阅读:2907

happy - hello
我看了weex官方文档上有实现跨页面的通信
A页面:
const Steve = new BroadcastChannel('Avengers')
Steve.postMessage('Assemble!')
B页面:
const Stark = new BroadcastChannel('Avengers')
Stark.onmessage = function (event) {
console.log(event.data) // Assemble!
Stark.postMessage('I am Tony and I am leaving now.')
}
经过测试,好像有一定的问题,只有在开发模式的时候才能生效。
水沟小鱼 (作者)
我后来也是用了这个法子,所以我不打算再用nvuel了,太坑了
2019-03-03 21:02