1
votes

I want to change the style of my table row after it's item was edited. I used vuex and BootstrapVue here.

b-table prop tbody-tr-class setted to rowClass method

<b-table
  :tbody-tr-class="rowClass"
  ...
>

rowClass method looks like

rowClass(item, type) {
  if (item.status) return 'table-' + item.status

}

Item update method in Component.vue where item status setted.

editItem(item) {
  item.status = 'success'
  this.$store.dispatch(UPDATE_ITEM, item)
  ...
},

I had an error

Invalid prop: type check failed for prop "tbodyTrClass". Expected String, Array, got Function

But next Description is given in official bootstrap-vue docs

Property tbodyTrClass

Type String, Array or Function

Description Classes to be applied to every row on the table. If a function is given, it will be called as tbodyTrClass( item, type ) and it may return an Array, Object or String.

Everything I did looks for me the same as in example here

1
works for me: jsfiddle.net/gd87Lk6c, are you sure you're using the most recent version of BootstrapVue?thanksd
update 2.0.0-rc.11 -> 2.0.0-rc.13 helped. Thanks a lot!!!Crampus

1 Answers

0
votes

Upgrade to the latest version of Vue and BootstrapVue.