mirror of https://github.com/vuejs/core.git
chore: remove warnRecursiveComputed (#13128)
This commit is contained in:
parent
5cf205e355
commit
ff31f50b87
|
@ -119,12 +119,6 @@ export class ComputedRefImpl<T = any> implements Dependency, Subscriber {
|
||||||
// dev only
|
// dev only
|
||||||
onTrigger?: (event: DebuggerEvent) => void
|
onTrigger?: (event: DebuggerEvent) => void
|
||||||
|
|
||||||
/**
|
|
||||||
* Dev only
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
_warnRecursive?: boolean
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public fn: ComputedGetter<T>,
|
public fn: ComputedGetter<T>,
|
||||||
private readonly setter: ComputedSetter<T> | undefined,
|
private readonly setter: ComputedSetter<T> | undefined,
|
||||||
|
|
|
@ -1,17 +1,10 @@
|
||||||
import { type ComputedRefImpl, computed as _computed } from '@vue/reactivity'
|
import { computed as _computed } from '@vue/reactivity'
|
||||||
import { getCurrentInstance, isInSSRComponentSetup } from './component'
|
import { isInSSRComponentSetup } from './component'
|
||||||
|
|
||||||
export const computed: typeof _computed = (
|
export const computed: typeof _computed = (
|
||||||
getterOrOptions: any,
|
getterOrOptions: any,
|
||||||
debugOptions?: any,
|
debugOptions?: any,
|
||||||
) => {
|
) => {
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
const c = _computed(getterOrOptions, debugOptions, isInSSRComponentSetup)
|
return _computed(getterOrOptions, debugOptions, isInSSRComponentSetup) as any
|
||||||
if (__DEV__) {
|
|
||||||
const i = getCurrentInstance()
|
|
||||||
if (i && i.appContext.config.warnRecursiveComputed) {
|
|
||||||
;(c as unknown as ComputedRefImpl<any>)._warnRecursive = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return c as any
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,12 +149,6 @@ export interface AppConfig {
|
||||||
*/
|
*/
|
||||||
isCustomElement?: (tag: string) => boolean
|
isCustomElement?: (tag: string) => boolean
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO document for 3.5
|
|
||||||
* Enable warnings for computed getters that recursively trigger itself.
|
|
||||||
*/
|
|
||||||
warnRecursiveComputed?: boolean
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to throw unhandled errors in production.
|
* Whether to throw unhandled errors in production.
|
||||||
* Default is `false` to avoid crashing on any error (and only logs it)
|
* Default is `false` to avoid crashing on any error (and only logs it)
|
||||||
|
|
Loading…
Reference in New Issue