[Vuejs]-Vue-table-2 with Vuex – not able to change the count property

0👍

watch: {
    'companies': {
    handler (newValue, oldValue) {
        this.totalRows=this.companies.length;
    },
    deep: true
    }
},

Vue “watch” is a powerful reactive option attribute to the vue framework that helps front-end developers listen to changes made on a value and then react to it.
So, once the totalRows is set, you can assign it to the table attributes and the table will change accordingly.
For my case, I used it for bootstrap table as follows:

    <b-pagination
        :total-rows="totalRows"
        :per-page="perPage"
></b-pagination>

Leave a comment