[Vuejs]-Watcher ignores changes in the store

0๐Ÿ‘

โœ…

I figured it out. I need to create a new Object when mutating the state:

// mutations
const mutations = {
    [types.CHANGE_PAGE] (state, {key, value}) {
        state[key] = Object.assign({}, state[key], value);
    },
    [types.CHANGE_PER_PAGE] (state, {key, value}) {
        state[key] = Object.assign({}, state[key], value);
    },
};

Leave a comment