Skip to content

IndexBar

示例

html
<template>
  <pa-index-bar>
    <view v-for="index in indexes.length" :key="index">
      <pa-index-anchor :index="indexes[index - 1]" />
      <pa-cell v-for="cellIndex in 12" :key="cellIndex" title="文本" />
    </view>
  </pa-index-bar>
</template>
ts
<script setup lang="ts">
const indexes = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')
</script>

IndexBar Props

参数说明类型默认值
indexList索引字符列表(string|number)[]() => []
zIndexz-index 层级number1
sticky是否开启锚点自动吸顶booleantrue
stickyOffsetTop锚点自动吸顶时与顶部的距离number0

IndexAnchor Props

参数说明类型默认值
index索引字符string | number''

IndexBar Event

事件名参数

IndexAnchor Event

事件名参数

IndexBar Slot

名称说明
default-

IndexAnchor Slot

名称说明

样式变量

名称默认值
--pa-index-bar-sidebar-z-index2
--pa-index-bar-index-font-weight500
--pa-index-bar-index-font-size10px
--pa-index-bar-index-line-height16px