My Vuex store has a state variable called scannedList
, which is initially set to an empty array []
:
state: {
scannedList: []
}
I have a mutation that adds ids to this array. I attempted to clear the entire state by using:
store.commit('addToScannedList', [])
However, the ids are still present in the array. What is the correct way to achieve this?