When attempting to update an array that utilizes Vue's "ref", I encounter a specific issue.
Below is a snippet of the code I'm working with:
<script setup>
import { ref } from 'vue';
let arr = ref([]);
function updateArray(val) {
arr.value.push(val);
console.log(arr.value);
}
</script>
Although the console displays the updated array as expected, the functionality within the component that relies on these updated values does not work.
After installing the Vue dev tools Chrome extension and inspecting the component's array, I noticed that the variable never updates. It appears like this:
arr: Array[0] (Ref)
Can anyone provide insight into why my array fails to update?
Thank you,