# IndexBar 索引栏 用于列表的索引分类显示和快速定位。 ## 基本用法 使用一个固定高度的元素包裹`wd-index-bar`组件,组件的宽高会和包裹元素相同。 将`wd-index-anchor`作为子组件使用,会根据 anchor 组件的`index`属性生成锚点以及侧边栏。 ```vue ``` ## 更新列表数据 列表数据如果需要更新,可以参考此示例 ::: details 查看更新列表数据示例 ::: code-group ```html [vue] ``` ```typescript [typescript] ``` ```css [css] .wraper { height: calc(100vh - var(--window-top)); height: calc(100vh - var(--window-top) - constant(safe-area-inset-bottom)); height: calc(100vh - var(--window-top) - env(safe-area-inset-bottom)); } ``` ::: ## Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | | ------ | ------------ | ------- | ------ | ------ | -------- | | sticky | 索引是否吸顶 | boolean | - | false | - | ## IndexAnchor Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | 最低版本 | | ----- | -------- | ---------------- | ------ | ------ | -------- | | index | 索引字符 | string / number | - | - | - | ## IndexAnchor Slots | name | 说明 | 参数 | 最低版本 | | ------- | ---------- | ---- | -------- | | default | 自定义内容 | - | - | ## IndexAnchor 外部样式类 | 类名 | 说明 | 最低版本 | | ----------- | ------------ | -------- | | customStyle | 自定义样式 | - | | customClass | 自定义样式类 | - |