Vue中数组元素被替换,页面没有动态展示

原始代码

 

 页面没有相应goodsList替换,打印goodsList数据已经被替换;

 

 

 

 

(借用https://www.cnblogs.com/belongs-to-qinghua/p/11112613.html的图) 

文档中明确指出,vue不能检测上述数组的变动,同时文档中也指出了实现上述需求的方法:

Vue.set(vm.goodList,i,result.goods);

 

 

 

posted @ 2019-11-22 17:41  君主-bye  阅读(883)  评论(0)    收藏  举报