weex icon indicating copy to clipboard operation
weex copied to clipboard

关于<list>在iOS端里面的优化问题

Open voidxin opened this issue 10 years ago • 1 comments

接口反馈大约有8000条数据,获取数据后如下显示:

 <list>
            <cell repeat="{{groups}}">
                <div style="height: 150;flex-direction: row;align-items: center;" onclick="cellClick($index)">
	                <div style="flex:0.9;">
	                	 <text style="font-size: 35;margin-left: 15;">{{shopName}}</text>
	                </div>

	                <div style="flex:0.1;justify-content: center;">
	                	<text style="font-size: 35;text-align: center;"> > </text>
	                </div>

                   
     
                </div>
                <bottom-line></bottom-line>
             </cell>

       </list>

在iOS端中,我发现界面显示出来后很卡,并且应该是8000个cell一直在渲染,点击事件不响应,得等五六分钟全部渲染完成后点击事件才响应。。 1:所以我想知道是不是在iOS中cell没有被重用,界面显示时一直在循环创建8000多个cell导致变卡、点击事件被阻挡。。 2:我该怎么优化?

voidxin avatar Nov 24 '16 03:11 voidxin

@voidxin List cell的重用只是UIView层面的重用, 所有 dom 和 component tree都是要被建立的, 8000个cell确实比较多, 建议在数据上进行分隔, 利用loadmore事件进行懒加载, 另外点击事件响应如果是跳转, 建议使用 a 链接进行跳转。

cxfeng1-zz avatar Nov 24 '16 03:11 cxfeng1-zz