Skip to content

reactiveComputed

Category
Export Size
288 B
Last Changed
3 hours 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

SourceDocs

Contributors

jorshen

Changelog

No recent changes

Released under the MIT License.