显示的list列表怎么能动态的检测到集合数据的变化,从后端查出来的数据,我想让他一秒显示出来一个,但是定时过后现在拿到集合以后一下就显示了,并不是按照定时的频率一个个显示
下方是列表代码
<uni-list-item id="list" v-for="(item,index) in list" v-bind:key="index" show-badge="true" :badge-text="item.phone" :title="item.name"
show-arrow="false">
</uni-list-item>
下方是js代码
uni.showToast({
title: that.gatherNum+'.'+name+' '+phone,
icon: 'none',
duration: 2000,
// position:'bottom',
success:function(){
console.log(name+"--"+phone);
// that.$set(that.list,"name",name);
// that.$set(that.list,"phone",phone);
that.list.push({
name:name,
phone:phone
});
that.gatherNum = that.gatherNum + 1;
setStore(name,phone);
}
})
求大神指教!
1 个回复
1***@qq.com
另外定义一个数组,每秒push一下