this.$delete delete this.$set
var a=[1,2,3,4]var b=[1,2,3,4]delete a[1]console.log(a)//134length4 (变为undefined)this.$delete(b,1)console.log(b)//134length3(完成删除)let obj={a:1,b:2}this.set去改变数组对象,vue能响应变化this.set去改...
var a=[1,2,3,4]
var b=[1,2,3,4]
delete a[1]
console.log(a) //134 length4 (变为undefined)
this.$delete(b,1)
console.log(b) //134 length3 (完成删除)
let obj={a:1,b:2}
this.
s
e
t
去
改
变
数
组
对
象
,
v
u
e
能
响
应
变
化
t
h
i
s
.
set去改变数组对象,vue能响应变化 this.
set去改变数组对象,vue能响应变化this.set(a,1,0)
this.$set(obj,a,0)
更多推荐
所有评论(0)