reactiveComputed
リアクティブな算出オブジェクト。 `computed` が ref を返すのに対し、`reactiveComputed` はリアクティブなオブジェクトを返します。
この関数は Proxy を使用します。
IE 11 以前ではサポートされていません。 IE 11 以前のブラウザ。
使用方法
ts
import { reactiveComputed } from '@vueuse/core'
const state = reactiveComputed(() => {
return {
foo: 'bar',
bar: 'baz',
}
})
state.bar // 'baz'
型宣言
typescript
/**
* Computed reactive object.
*/
export declare function reactiveComputed<T extends object>(
fn: () => T,
): UnwrapNestedRefs<T>