MCPcopy
hub / github.com/vuejs/core / computed

Function computed

packages/runtime-core/src/apiComputed.ts:4–17  ·  view source on GitHub ↗
(
  getterOrOptions: any,
  debugOptions?: any,
)

Source from the content-addressed store, hash-verified

2import { getCurrentInstance, isInSSRComponentSetup } from './component'
3
4export const computed: typeof _computed = (
5 getterOrOptions: any,
6 debugOptions?: any,
7) => {
8 // @ts-expect-error
9 const c = _computed(getterOrOptions, debugOptions, isInSSRComponentSetup)
10 if (__DEV__) {
11 const i = getCurrentInstance()
12 if (i && i.appContext.config.warnRecursiveComputed) {
13 ;(c as unknown as ComputedRefImpl<any>)._warnRecursive = true
14 }
15 }
16 return c as any
17}

Callers 7

applyOptionsFunction · 0.90
setupFunction · 0.50
apiWatch.spec.tsFile · 0.50
setupFunction · 0.50
apiOptions.spec.tsFile · 0.50
Suspense.spec.tsFile · 0.50

Calls 1

getCurrentInstanceFunction · 0.90

Tested by 2

setupFunction · 0.40
setupFunction · 0.40