Closed as not planned
Description
Vue version
3.5.16
Link to minimal reproduction
Steps to reproduce
const firstResult = ref(0); const result = ref(10); let runs = 0; const c1 = computed(() => { let x = firstResult.value; const shouldTakeResult = runs > 0; // or Math.round(Math.random()) if (shouldTakeResult) { x = result.value; } runs++; return x; }); console.warn('c1', c1.value); result.value = 100; await nextTick(); console.warn('c1', c1.value); // computation is not triggered result.value = 1000; await nextTick(); console.warn('c1', c1.value); // nope, still 0
What is expected?
c1 should recompute
What is actually happening?
c1 does not recompute :)
System Info
Any additional comments?
I know I can add result somewhere before the "if" to let vue know I'm going to use this dependency, but not everyone knows about it and it can lead to bugs.
Metadata
Metadata
Assignees
Labels
No labels