weex - this.$getConfig().bundleUrl取值问题

查看:341
本文介绍了weex - this.$getConfig().bundleUrl取值问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

为什么在android模拟器上获取不到this.$getConfig().bundleUrl的值,this.$getConfig() 只有env属性?

解决方案

bandleUrl得自己传进去,详见
官方的weex工程里面的AbstractWeexActivity文件,
`

protected void renderPageByURL(String url,String jsonInitData){
AssertUtil.throwIfNull(mContainer,new RuntimeException("Can't render page, container is null"));
Map<String, Object> options = new HashMap<>();
options.put(WXSDKInstance.BUNDLE_URL, url); //* 这里赋值到bandleUrl进去 * 
mInstance.setTrackComponent(true);
mInstance.renderByUrl(
  getPageName(),
  url,
  options,
  jsonInitData,
  ScreenUtil.getDisplayWidth(this),
  ScreenUtil.getDisplayHeight(this),
  WXRenderStrategy.APPEND_ASYNC);

}
`

这篇关于weex - this.$getConfig().bundleUrl取值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆