声明有ref的reactive对象
ts
let obj = reactive({
a:1,
b:2,
c:ref(3)
})
console.log(obj.a)
console.log(obj.b)
console.log(obj.c)//reactive中会把ref对象自动拆包,不用再写.value
let obj = reactive({
a:1,
b:2,
c:ref(3)
})
console.log(obj.a)
console.log(obj.b)
console.log(obj.c)//reactive中会把ref对象自动拆包,不用再写.value