0๐
I had initially installed Vuex with npm install vuex@4.0.0-beta.4
, but I should have done npm install vuex@next
. After installing it properly, the error went away.
-1๐
Try to use Spread syntax like in VUEX Documentation:
const state = {
flash: []
};
const mutations = {
PUSH_FLASH(state, payload) {
state.flash = [...state.flash, payload]
}
};
Source:stackexchange.com