为了账号安全,请及时绑定邮箱和手机立即绑定

Weex 导航到选中 tabbar item 扩展方法

Weex 导航到选中 tabbar item 扩展方法

慕田峪9158850 2018-10-09 19:27:57
android平台 weex sdk 0.10.0tabbar是在 instanceId =1 在当前实例很简单,在其他 instance时候,如何切回 tabbar的某一项,没有对应方法。看文档,我的思路是 BroadcastChannel在不同实例通讯完成const broadCastChannel = new BroadcastChannel('tab');             //bind message handler     broadCastChannel.onmessage = function (event) {           console.log(event.data);     }其他实例 调用下面方法 postMessagevar tabChannel;function tab(url){     tabChannel = new BroadcastChannel('tab');     tabChannel.postMessage(url);     tabChannel.close();     tabChannel = null; }真机运行,以为可以解决了,实际运行 BroadcastChannel is not defined,那就是 js框架不支持BroadcastChannel ,不知道怎么弄了,有朋友有解决方法吗?在其他实例,切回 tabbar的某一项,思路2:js getInstance 获取到 instanceId=1 这个实例,不知道这个思路是否可行,js 有无 getInstace 方法
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 848 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信