当遇到返回的值为proxy对象时,结构如下
可使用 toRaw() 方法获取原始对象。
// 导入toRaw函数
import { toRaw } from '@vue/reactivity'
// 进行proxy对象转化(item为未转化的proxy对象)(end为转化后的结果)
const end = toRaw(item)
// 输出可以看到已经不是proxy对象了
console.log(end)
当遇到返回的值为proxy对象时,结构如下
可使用 toRaw() 方法获取原始对象。
// 导入toRaw函数
import { toRaw } from '@vue/reactivity'
// 进行proxy对象转化(item为未转化的proxy对象)(end为转化后的结果)
const end = toRaw(item)
// 输出可以看到已经不是proxy对象了
console.log(end)