Skip to content

FilterPopover 筛选弹层

悬停触发的下拉筛选面板,常用于列表头筛选。

基础用法

排序 ▾
当前选中:time
vue
<script setup>
import { ref } from 'vue'
const sortBy = ref('time')
const options = [
  { label: '时间排序', value: 'time' },
  { label: '名称排序', value: 'name' },
  { label: '热度排序', value: 'hot' }
]
</script>

<template>
  <MFilterPopover v-model="sortBy" :options="options">
    <template #trigger>
      <span>排序 ▾</span>
    </template>
  </MFilterPopover>
</template>

Props 属性

属性名类型默认值说明
modelValuestring | number-选中的值(v-model)
options{ label, value }[]-选项列表

Events 事件

事件名参数说明
update:modelValue(value)选中变化时触发

Slots 插槽

插槽名说明
trigger触发弹层的元素

Released under the MIT License.