Skip to content

reactiveComputed ​

Category
Export Size
288 B
Last Changed
5 minutes ago

计算响应式对象。与 computed 返回一个 ref 不同,reactiveComputed 返回一个响应式对象。

用法 ​

ts
import { reactiveComputed } from '@vueuse/core'

const state = reactiveComputed(() => {
  return {
    foo: 'bar',
    bar: 'baz',
  }
})

state.bar // 'baz'

Type Declarations ​

typescript
/**
 * Computed reactive object.
 */
export declare function reactiveComputed<T extends object>(
  fn: ComputedGetter<T>,
): UnwrapNestedRefs<T>

Source ​

Source • Docs

Contributors ​

jojo

Changelog ​

No recent changes

Released under the MIT License.