weex - this.$getConfig().bundleUrl取值问题
本文介绍了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屋!
查看全文