Skip to content

IndexList 索引列表

A-Z 字母索引列表。支持数据分组、右侧索引导航条、分组标题吸顶、搜索过滤。

基础用法

vue
<template>
  <see-index-list :data="data" @on-select="onSelect" />
</template>

<script setup>
const data = [
  { index: 'A', name: 'Alice' },
  { index: 'B', name: 'Bob' },
  { index: 'C', name: 'Charlie' }
]

const onSelect = (item) => {
  console.log('选中:', item)
}
</script>

带搜索框

vue
<template>
  <see-index-list :data="data" :is-show-search="true" />
</template>

IndexListItem

属性类型说明
indexstring索引值(如 A, B, C)
namestring显示名称
pinyinstring拼音(可选)
firstLetterstring首字母(可选)

Props

属性类型默认值说明
dataIndexListItem[][]数据列表
indexListstring[][]自定义索引列表
indexKeystring'index'索引字段名
isPinyinbooleanfalse是否启用拼音索引
isShowSearchbooleanfalse是否显示搜索框
isStickyHeaderbooleantrue分组标题是否吸顶
heightstring | number'100%'列表高度
isVirtualbooleanfalse是否启用虚拟滚动

Events

事件名参数说明
onSelectitem选中项
onIndexChangeindex索引变更

辽 ICP 备 2025070134 号