定义数组
const arr1 = ref([])
const arr2 = reactive([])
let state = reactive({
arr3 = []
})
接口返回值赋值 res.list
state.arr3 = res.list
arr2.push(...[res.list])
arr1.value = res.list
注意:
arr2 = res.list 这时候已经失去了响应式。需要使用push
定义数组
const arr1 = ref([])
const arr2 = reactive([])
let state = reactive({
arr3 = []
})
接口返回值赋值 res.list
state.arr3 = res.list
arr2.push(...[res.list])
arr1.value = res.list
注意:
arr2 = res.list 这时候已经失去了响应式。需要使用push