k***@163.com
k***@163.com
  • 发布:2016-10-12 14:28
  • 更新:2017-07-04 14:28
  • 阅读:1260

tab webview的子页面中使用indexdList不能预加载?

分类:MUI

使用的是HBuilder的tab webview模板,预加载的其中一个页面我做成了indexdList

<script type="text/javascript" charset="utf-8">  
            mui.init();  
            mui.ready(function() {  
                //var header = document.querySelector('header.mui-bar');  
                var list = document.getElementById('list');  
                //calc hieght  
                //list.style.height = (document.body.offsetHeight - header.offsetHeight) + 'px';  
                list.style.height = document.body.offsetHeight + 'px';  
                //create  
                window.indexedList = new mui.IndexedList(list);  
            });  
        </script>

indexlist 的 DOM结构是从模板中拷贝过来的,就是机场的索引列表那个模版
稍微做了修改,添加显示图片。
单页在浏览器中是显示正常的。在手机调试就有问题,点击tab打开这个子页面就是空白的。此时如果我在HBiulder里面对当前页面做任何修改,做保存动作,会自动同步到手机调试,页面就能正常显示了。

我现在不知道问题出在哪。似乎在main页面预加载子页面时,当前列表页并没有预加载成功?是添加的图片影响了加载吗?

main页面预加载的代码是模板里的,没有做过修改,如下

//创建子页面,首个选项卡页面显示,其它均隐藏;  
var subpages = ['tab-subpage-chat.html', 'tab-subpage-contact.html', 'tab-subpage-discover.html', 'tab-subpage-setting.html'];  
            mui.plusReady(function() {  
                var self = plus.webview.currentWebview();  
                for (var i = 0; i < 4; i++) {  
                    var temp = {};  
                    var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);  
                    if (i > 0) {  
                        sub.hide();  
                    }else{  
                        temp[subpages[i]] = "true";  
                        mui.extend(aniShow,temp);  
                    }  
                    self.append(sub);  
                }  
            });
2016-10-12 14:28 负责人:无 分享
已邀请:
chinahappybeer

chinahappybeer - china happy beer

我也出现这问题,请问楼主解决了吗?

该问题目前已经被锁定, 无法添加新回复