Is there a way to dynamically hide / show (display) a table row in a dynamic bootstrap-vue table?
I'm currently using the _rowVariant
prop to create a class on the row, which is working, but I'm having trouble figuring out how to additionally connect the show_old_projects
value to the row's display... since the rows are added dynamically.
<b-form-checkbox v-model="show_old_projects" value="true" unchecked-value="false">
Show old projects
</b-form-checkbox>
<b-table :fields="fields" :items="projects" :filter="filter"></table>
...
validateProjects() {
for (const project of this.projects){
if (project.end_date < this.date) {
project._rowVariant = 'muted';
}
}
}
...
.table-muted {
@extend .text-muted;
}
Any ideas?
b-table
would be your best bet. you can use Javascript's built inArray.prototype.filter(...)
method – Troy Morehouse