首页 > Web开发 > 详细

Vue 设置添加 JSON 视图不更新

时间:2018-08-30 12:15:31      阅读:537      评论:0      收藏:0      [点我收藏+]
 1         for (let i = 0; i < this.gotup.length; i++) {
 2                 const element = this.gotup[i];
 3                 console.log(element);
 4                 if (element) {
 5                 }
 6                 for (let io = 0; io < element.LstAttValue.length; io++) {
 7                     const elements = element.LstAttValue[io];
 8                     if (ValueId == elements.AttValueId) {
 9                         // Object.assign(elements, {不起作用的
10                         //     isTrue: false 
11                         // });
12                         // elements.isTrue = true;  不起作用的
13                         // elements[isTrue] = true; 不起作用的
14                         this.$set(elements, "isTrue", true); // 这样才对
15                     } else {
16                         this.$set(elements, "isTrue", false);
17                     }
18                     console.log(elements);
19                 }
20             }

 

Vue 设置添加 JSON 视图不更新

原文:https://www.cnblogs.com/hasubasora/p/9559407.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!