This code does not generate an error but when I change the count it does not display the results on the screen. Please help me solve this problem.
import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: { lists: [ { title: "User", count: 15, }, { title: "Admin", count: 41, }, { title: "Total Members", count: 100, }, { title: "Manager", count: 35, } ] }, mutations: { updateMessage (state, count) { state.lists.count = count } }, actions: { }, modules: { } })
First of all, you don't need v-model to update your store. You can create local copies and update them instantly.
Second thing, I don't think you want to update the entire count of every object, but I think you want to update one item in particular.
This is what I'm going to do: