arr.push()追加正常
this.msg_list.push(message);
console.log('push增加id:'+message.id);
arr.unshift()追加出错
this.msg_list.unshift(message);
console.log('unshift增加id:'+message.id);
arr.push()追加正常
this.msg_list.push(message);
console.log('push增加id:'+message.id);
arr.unshift()追加出错
this.msg_list.unshift(message);
console.log('unshift增加id:'+message.id);
aiyide (作者)
传递参数依然出错:this.msg_list=[...[msg],...this.msg_list];
传递参数正常:this.msg_list=[...this.msg_list,...[msg]];