Closed bkuster closed 2 years ago
When creating a reactive array and using it in a computed, changes to the array (using push etc.) does not trigger the computed property as expected.
See this code pen for a working example of this in Vue3.
{ setup() { const foo = reactive([]); const bar = computed(() => foo.map(f => f)); setTimeout(() => { foo.push(true); } , 1000); return { bar, }; }, }
Use ref for []
composition-api/issues/219
okay, so this is a known limitation and i have simply missread the documentation, assuming, if i have a reactive array, i will need refs within said array. sorry for the noise.
Issue
When creating a reactive array and using it in a computed, changes to the array (using push etc.) does not trigger the computed property as expected.
See this code pen for a working example of this in Vue3.