本文共 198 字,大约阅读时间需要 1 分钟。
今天遇到一个奇怪的问题,修改了对象的属性值之后页面没有同步更新,说是官方解释vue不能检测到对象属性的添加或删除。但是用this.$set(obj,key,val)可以解决
代码如下:
这样就可以修改this.array[1]的那个对象为{type:3,title:“提现到银行卡”,checked:0}了。
还看到一种方法,可以强制刷新页面(没有测试过):this.$forceUpdate()
转载地址:http://azrgn.baihongyu.com/