[Vuejs]-Why is this Vuex state syntax throwing error?

1👍

Your syntax is wrong on your object "state". If you want it to be an object that contains an array, you need to set it a value like so:

state: {
  newArray: [...]
}

You can’t just have an object that contains an array and is not set with a key.

Leave a comment