Vue.js Vuejs/Buetify:使用b表的可搜索属性清除搜索过滤器
我正在使用Vue.js Vuejs/Buetify:使用b表的可搜索属性清除搜索过滤器,vue.js,v-model,buefy,Vue.js,V Model,Buefy,我正在使用buefy创建一个列中包含输入过滤器的表。 这就是它看起来的样子: <b-table :data="cars" :sticky-header="true" :selected.sync="selected" > <template slot-scope="props"> <
buefy
创建一个列中包含输入过滤器的表。
这就是它看起来的样子:
<b-table
:data="cars"
:sticky-header="true"
:selected.sync="selected"
>
<template slot-scope="props">
<template v-for="column in columns">
<b-table-column :key="column.id" v-bind="column">
<template
v-if="column.searchable"
slot="searchable"
slot-scope="props"
>
<b-input
v-model="props.filters[props.column.field]"
placeholder="Search..."
icon="magnify"
size="is-small"
/>
</template>
{{ props.row[column.field] }}
</b-table-column>
</template>
</template>
</b-table>
...
...
data () {
return {
selected: null,
columns: [
{
field: 'constructor',
label: 'Constructor',
searchable: true
},
....
]
}
{{props.row[column.field]}
...
...
数据(){
返回{
选中:空,
栏目:[
{
字段:“构造函数”,
标签:“构造函数”,
可搜索:正确
},
....
]
}
我希望能够清除搜索的字段。
有什么建议吗?您的
b-input
绑定到props.filters[props.column.field]
,因此这意味着您应该能够添加一个图标来重置此值:
请让我知道这是否有效