Skip to content

Commit a66a776

Browse files
authored
fix(computed): When no dependencies are passed in, computed does not use the cache. vuejs#12857
1 parent 263f63f commit a66a776

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/reactivity/src/effect.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,7 @@ export function refreshComputed(computed: ComputedRefImpl): undefined {
386386
if (
387387
dep.version > 0 &&
388388
!computed.isSSR &&
389-
computed.deps &&
390-
!isDirty(computed)
389+
(computed.deps ? !isDirty(computed) : !(computed.flags & EffectFlags.DIRTY))
391390
) {
392391
computed.flags &= ~EffectFlags.RUNNING
393392
return

0 commit comments

Comments
 (0)