修改数据显示
parent
e6816a231a
commit
b1c5db9d2c
|
|
@ -995,18 +995,18 @@
|
|||
update_display_video_list(list) {
|
||||
try {
|
||||
// 不理解为什么这里时undefined的
|
||||
// 根据 weex 的通用做法,需要同时改变“引用”和“长度”两个维度才能被识别数组更新。
|
||||
// 1. 先清空原数组(触发长度变化)
|
||||
if (this.display_video_list && this.display_video_list.length > 0) {
|
||||
this.display_video_list.splice(0, this.display_video_list.length)
|
||||
} else {
|
||||
this.display_video_list = [];
|
||||
}
|
||||
// this.$nextTick(() => {
|
||||
// setTimeout(() => {
|
||||
// 2. 再把新数据 push 进去(触发内容变化)
|
||||
list.forEach(item => this.display_video_list.push(item))
|
||||
// }, 0);
|
||||
// 根据 weex 的通用做法,需要同时改变“引用”和“长度”两个维度才能被识别数组更新。
|
||||
// 1. 先清空原数组(触发长度变化)
|
||||
if (this.display_video_list && this.display_video_list.length > 0) {
|
||||
this.display_video_list.splice(0, this.display_video_list.length)
|
||||
} else {
|
||||
this.display_video_list = [];
|
||||
}
|
||||
// this.$nextTick(() => {
|
||||
// setTimeout(() => {
|
||||
// 2. 再把新数据 push 进去(触发内容变化)
|
||||
list.forEach(item => this.display_video_list.push(item))
|
||||
// }, 0);
|
||||
// });
|
||||
} catch (e) {
|
||||
console.log('update_display_video_list', e);
|
||||
|
|
|
|||
Loading…
Reference in New Issue