首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

索引列表 | Index List

索引列表,可由右侧索引导航快速定位到相应的内容。

引入

代码语言:javascript
复制
import { IndexList, IndexSection } from 'mint-ui';

Vue.component(IndexList.name, IndexList);
Vue.component(IndexSection.name, IndexSection);

例子

代码语言:javascript
复制
<mt-index-list>
  <mt-index-section index="A">
    <mt-cell title="Aaron"></mt-cell>
    <mt-cell title="Alden"></mt-cell>
    <mt-cell title="Austin"></mt-cell>
  </mt-index-section>
  <mt-index-section index="B">
    <mt-cell title="Baldwin"></mt-cell>
    <mt-cell title="Braden"></mt-cell>
  </mt-index-section>
  ...
  <mt-index-section index="Z">
    <mt-cell title="Zack"></mt-cell>
    <mt-cell title="Zane"></mt-cell>
  </mt-index-section>
</mt-index-list>

mt-index-section 与右侧导航中的索引一一对应,mt-index-sectionindex 属性即为与其对应的索引的显示文本。mt-index-section 标签内可为任意自定义内容。

当手指在右侧导航中滑动时,会在列表中间显示一个目前索引值的提示符。若不需要提示符,只需将 show-indicator 设为 false

代码语言:javascript
复制
<mt-index-list :show-indicator="false">
  ...
</mt-index-list>

API

mt-index-list

参数

说明

类型

可选值

默认值

height

组件的高度。若不指定,则自动延伸至视口底

Number

showIndicator

是否显示索引值提示符

Boolean

true

mt-index-section

参数

说明

类型

可选值

默认值

index

索引值(必需参数)

String

Slot

mt-index-list

name

描述

-

一个或多个 mt-index-section 组件

mt-index-section

name

描述

-

单个 mt-index-section 的内容

扫码关注腾讯云开发者

领取腾讯云代金券