Skip to content
在新窗口打开实时预览

IndexAnchor 索引锚点 ​

定义索引列表中的分组位置,可在页面型 IndexList 或容器型 IndexListPanel 中使用。

平台兼容性 ​

H5App微信小程序支付宝小程序
√√√√

基础用法 ​

vue
<snake-index-list-panel :index-list="['A']">
  <snake-index-anchor index="A" text="A 类商品" />
  <view>Apple</view>
</snake-index-list-panel>

自定义内容 ​

vue
<snake-index-anchor index="HOT" use-slot>
  <view class="custom-anchor">热门城市</view>
</snake-index-anchor>

API ​

Props ​

参数说明类型默认值
index对应父级 indexList 的值string | number必填
text展示文字;为空时显示 indexstring''
useSlot是否优先使用默认插槽booleanfalse
customClass自定义类名string''
customStyle锚点自定义样式string | object | array''

Slots ​

插槽名说明
defaultuseSlot 为 true 时替换文字

主题变量 ​

变量名说明
--snake-color-text锚点文字颜色
--snake-color-background锚点背景颜色

为 uni-app 商城与 CMS 场景设计