vuejs-challenges icon indicating copy to clipboard operation
vuejs-challenges copied to clipboard

3 - 响应性丟失

Open undefined-zzk opened this issue 1 year ago • 0 comments

// 你的答案

`

function useCount() { const state = reactive({ count: 0, })

function update(value: number) { state.count = value }

return { ...toRefs(state), // count:toRef(state,'count'), update } }

// Ensure the destructured properties don't lose their reactivity const { count , update } = useCount()

`

undefined-zzk avatar Jan 30 '24 09:01 undefined-zzk