Skip to content

filter-field 筛选栏

filter-field 是一个集成了下拉筛选、排序、标签筛选和高级筛选的复合组件。

基础用法

vue
<template>
  <filter-field 
    :params="filterParams" 
    :showSearch="true"
    @confirm="onFilterConfirm"
  >
  </filter-field>
</template>

<script>
export default {
  data() {
    return {
      filterParams: {
        orderBy: '',
        selectTag: {},
        selectBrand: {},
        selectList: []
      }
    }
  },
  methods: {
    onFilterConfirm(params) {
      console.log('筛选参数', params);
    }
  }
}
</script>

Props

参数说明类型默认值
params筛选参数对象,包含 orderBy, selectTag, selectBrand, selectList 等Object{ orderBy: '', selectTag: {}, selectBrand: {}, selectList: [] }
showSearch是否显示搜索图标Booleanfalse

Events

事件名说明回调参数
confirm点击确认按钮或筛选发生变化时触发(params: Object)

Slots

插槽名说明
dropdown-left下拉菜单左侧自定义内容
dropdown-right下拉菜单右侧自定义内容
collapse-top高级筛选弹窗顶部的自定义内容