[Vuejs]-Select All table rows (not only by pages) in vue-good-table Vue component

0👍

Add to your table @on-select-all="selectAll"
So it looks like:

<vue-good-table
    @on-select-all="selectAll"    
    :columns="columns"
    :rows="rows"
    :select-options="{ enabled: true }">
</vue-good-table>

And create new method

selectAll(){
      this.row.forEach(item=>{
        if(item.vgtSelected){
          this.$set(item,'vgtSelected', false);
        }else{
          this.$set(item,'vgtSelected', true);
        }
      },this);
    }

This should solve your problem

Leave a comment