weex icon indicating copy to clipboard operation
weex copied to clipboard

刷新数据,list里的slider数据会成倍增长

Open liwenyou opened this issue 10 years ago • 7 comments

刷新数据,list里的slider数据会成倍增长,但是上下滚动,消失后再现就正常了,是不是底层cell可重用的时候没处理好? simulator screen shot 2016 11 29 16 12 37 simulator screen shot 2016 11 29 16 12 42 simulator screen shot 2016 11 29 16 13 23

liwenyou avatar Nov 29 '16 08:11 liwenyou

很多人遇到。andriod没问题,ios有问题

Jam1zhu avatar Dec 01 '16 00:12 Jam1zhu

@liwenyou , slider的数据是通过更新取得的,你可以参考下面几步再试一下:

  1. 更新完slider数据,将原数据清空;
  2. 通过setTimeout的方式,使用set方法重设数组项; 例如:
this.sliderArray = [];
var self = this;
setTimeout(function(){
     var l = temp.length; // temp为刷新后的数据
      for(var i = 0;i<l;i++){
            self.sliderArray.$set(i,temp[i]);
       }
 },0)

boboning avatar Dec 12 '16 09:12 boboning

还是不好使,直接没有数据了

liwenyou avatar Dec 12 '16 11:12 liwenyou

// self.data1_0 = []; // self.data1_0 = data[2]; var temp = data[2]; this.data1_0 = []; setTimeout(function(){ var l = temp.length; // temp为刷新后的数据 for(var i = 0;i<l;i++){ self.data1_0.$set(i,temp[i]); } },0)

simulator screen shot 2016 12 12 19 16 03

liwenyou avatar Dec 12 '16 11:12 liwenyou

@liwenyou , 建议先把数据打印一下,看下js中拿到的结果是否正确,如果还是有问题的话,麻烦再把代码片段提供地详细一些,方便我们排查。

boboning avatar Dec 23 '16 08:12 boboning

This PR/issue doesn't receive response since Weex migrated to Apache two years ago and this repository is no longer active yet.

Feel free to ask question in new repository and thanks for your contribution.

YorkShen avatar Feb 18 '19 12:02 YorkShen

This issue is outdated for a long time and will be closed now. You can create a new one if you still have questions.

Hanks10100 avatar May 16 '21 10:05 Hanks10100