[Vuejs]-Bootstrap-Vue table not updating unless debug is printed

0👍

Strange! I could answer it better if you had a fiddle or plnk setup. But still this could be due to a lag.

Try wrapping the function withtin setTimeout like

    rowClick(item, index, event) {
       setTimeout(function(){
          if(!event.ctrlKey) {
            this.selected.forEach(selectedItem => selectedItem._rowVariant = null);
            this.selected = [];
          }
          if(event.ctrlKey && this.selected.includes(item)) {
            item._rowVariant = null;
            this.selected = this.selected.filter(selectedItem => selectedItem !== item);
          } else {
            item._rowVariant = 'info';
            this.selected.push(item);
          }
        });
      }

Leave a comment