一般这种情况出现在数组和对象发生变化时,
若是对象,使用this.
s
e
t
(
)
=
>
t
h
i
s
.
set() => this.
set()=>this.$set( target, key, value )
若是数组中包含的对象发生变化,将该对象整个替换:
newData={
…array[idx],
/*更改的值/
}
array=[…array.slice(0,idx),newData,…array.slice(idx+1)]
Vue数据更新,视图DOM不更新
最新推荐文章于 2024-05-07 02:02:46 发布