dx(reactivity): add getter into computed side effect warning (#10386)

This commit is contained in:
Doctor Wu 2024-02-25 20:27:33 +08:00 committed by GitHub
parent 0f3da05ea2
commit 21e0d6b145
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ export class ComputedRefImpl<T> {
public _cacheable: boolean public _cacheable: boolean
constructor( constructor(
getter: ComputedGetter<T>, private getter: ComputedGetter<T>,
private readonly _setter: ComputedSetter<T>, private readonly _setter: ComputedSetter<T>,
isReadonly: boolean, isReadonly: boolean,
isSSR: boolean, isSSR: boolean,
@ -74,7 +74,7 @@ export class ComputedRefImpl<T> {
} }
trackRefValue(self) trackRefValue(self)
if (self.effect._dirtyLevel >= DirtyLevels.MaybeDirty_ComputedSideEffect) { if (self.effect._dirtyLevel >= DirtyLevels.MaybeDirty_ComputedSideEffect) {
__DEV__ && warn(COMPUTED_SIDE_EFFECT_WARN) __DEV__ && warn(COMPUTED_SIDE_EFFECT_WARN, `\n\ngetter: `, this.getter)
triggerRefValue(self, DirtyLevels.MaybeDirty_ComputedSideEffect) triggerRefValue(self, DirtyLevels.MaybeDirty_ComputedSideEffect)
} }
return self._value return self._value