主题
reactiveComputed
计算后的响应式对象。与 computed 返回一个 ref 不同,reactiveComputed 返回一个响应式对象。
🌐 Computed reactive object. Instead of returning a ref that computed does, reactiveComputed returns a reactive object.
用法
🌐 Usage
ts
import { reactiveComputed } from '@vueuse/core'
const state = reactiveComputed(() => {
return {
foo: 'bar',
bar: 'baz',
}
})
state.bar // 'baz'