I created a very simple table with bootstrap-vue where i can filter my data using the built-in filter.
The problem i have now is that i want to add another filter where i can input a number and get all the rows where value is higher than the specified number. I don't really know where to start with this, since i'm already using a filter. Can anyone suggest an approach i can take for thi? Any advice is appreciated.
<template>
<div class="overflow-auto">
<b-form-fieldset horizontal label="Filter" class="col-6">
<b-input v-model="filter" placeholder="Filter table.."></b-input>
</b-form-fieldset>
<b-table
id="my-table"
:filter="filter"
:fields="fields"
:items="items"
small
></b-table>
</div>
</template>
<script>
export default {
data() {
return {
filter: '',
fields: [{'key': 'asset', 'sortable': true}, {'key': 'value', 'sortable': false}, {'key': 'address', 'sortable': false}],
items: []
}
},
computed: {
rows() {
return this.items.length
}
},
}
</script>
computedproperty, for exampleprefilteredItems() { return this.items.filter(({value}) => value > 3); }and use it in your template:items="prefilteredItems"(replacing3with the value of a field you might have but which is not in your code snippet)