0

I have a Vue ref object that I declare and then make an empty array of arrays:

const modifiedSchedules = ref([])

onMounted(() => {
     modifiedSchedules.value = Array(selectedUserIDs.value.length).fill([]);
})

Then, I try to push to one of the sub-arrays like this:

const myFund = (index: number, myObject: {})... => {
    modifiedSchedules.value[index].push(myObject);
}

What I'm finding is that this code pushes to ALL the arrays in modifiedSchedules instead of just the one at the index. Am I misunderstanding something about how this works?

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.