[vuex] do not mutate vuex store state outside mutation handlers.

  • I’m using a q-table to display some data in a table. The data is saved in a vuex store and its giving me an error everytime I change the values with the pop up edit.

    Error: [vuex] do not mutate vuex store state outside mutation handlers.
    Error in callback for watcher "function () { return this._data.$$state }": "Error: [vuex] do not mutate vuex store state outside mutation handlers."

    How do I properly update the data in the store?

    Here is the code for the table:

        <div >
                class="mytable q-mb-md"
                :rows-per-page-options="[15, 25, 30, 50, 0]"
                <template v-slot:top-right>
                    <q-input borderless dense debounce="300" v-model="filter" placeholder="Search">
                    <template v-slot:append>
                        <q-icon name="search" />
                <template v-slot:body="props">
                    <q-tr :props="props">
                            v-for="(column) in props.cols"
                            :key="column.name" :props="props"
                            {{ props.row[column.name]}}
                            <q-popup-edit v-model="props.row[column.name]">
                            <q-input v-model="props.row[column.name]" dense autofocus counter />
    import { mapGetters } from 'vuex';
    export default {
        name : 'OrderTable',
          ...mapGetters('newdata', ['getData', 'getFileName', 'getColumnNames'])
                filter: '',
                selected: [],
                columns: this.$store.state.newdata.columns,
        methods: {
                const index = this.$store.state.newdata.metadata.requiredColumns.idColumn
                return index
                let selectState = 'none';
                    selectState = 'single'
                return selectState
    <style lang="scss">
            height: 500px; 
            thead tr:first-child th {
                /* bg color is important for th; just specify one */
                background-color: $secondary;
                    background-color: white;
            thead tr th {
                position: sticky;
                z-index: 1;
            thead tr:first-child th {
                top: 0;
            .q-table--loading thead tr:last-child th {
                /* height of all previous header rows */
                top: 48px;
                tr:nth-child(2n) {
                    background-color: #eeeded;

  • @fakedrpanda If you want to use data from vuex in more advanced form, ie searching, querying, updating then i STRONGLY suggest to use this:


    With this lib you can build models, those models could consume nested data and normalize them, you have excellent query capabilities and many more. In the context of q-table, you can use those queried data as computed property and this will maintains both reactivity and filtering. Meaning changes to data done via models will reflect to your data views (q-table etc.).

  • @qyloxe Thanks! Ima give it a try.
    And look what I found https://www.youtube.com/watch?v=_zKi8qrlgXc 😃

  • @fakedrpanda yep, definitely worth watching his materials. Good catch!

Log in to reply