在vue2中,我们可以使用Object.assign(this.$data, this.$options.data())重置所有值
但是我们如何在 vue3 中做同样的事情(一行编码),假设我的 setup() 是......
setup(props, context) {
let a = ref('value1')
let b = ref('value2')
let c = ref('value3')
function reset() {
Object.assign(????, ????) or ???? <-- ????
}
}
Run Code Online (Sandbox Code Playgroud)