/*! For license information please see 3113.6e6b3c14.js.LICENSE.txt */ (self.webpackChunk=self.webpackChunk||[]).push([["3113"],{89199:function(n,s,a){"use strict";a.r(s);var t=a("80681");let l=["innerHTML"];s.default={setup:()=>({html:""}),render:()=>((0,t.wg)(),(0,t.iD)("div",{class:"van-doc-markdown-body",innerHTML:'

IndexBar \u7D22\u5F15\u680F

\n

\u4ECB\u7ECD

\n

\u7528\u4E8E\u5217\u8868\u7684\u7D22\u5F15\u5206\u7C7B\u663E\u793A\u548C\u5FEB\u901F\u5B9A\u4F4D\u3002

\n

\u5F15\u5165

\n

\u901A\u8FC7\u4EE5\u4E0B\u65B9\u5F0F\u6765\u5168\u5C40\u6CE8\u518C\u7EC4\u4EF6\uFF0C\u66F4\u591A\u6CE8\u518C\u65B9\u5F0F\u8BF7\u53C2\u8003\u7EC4\u4EF6\u6CE8\u518C\u3002

\n
import { createApp } from 'vue';\nimport { IndexBar, IndexAnchor } from 'vant';\n\nconst app = createApp();\napp.use(IndexBar);\napp.use(IndexAnchor);\n
\n

\u4EE3\u7801\u6F14\u793A

\n

\u57FA\u7840\u7528\u6CD5

\n

\u70B9\u51FB\u7D22\u5F15\u680F\u65F6\uFF0C\u4F1A\u81EA\u52A8\u8DF3\u8F6C\u5230\u5BF9\u5E94\u7684 IndexAnchor \u951A\u70B9\u4F4D\u7F6E\u3002

\n
<van-index-bar>\n  <van-index-anchor index="A" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n\n  <van-index-anchor index="B" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n\n  ...\n</van-index-bar>\n
\n

\u81EA\u5B9A\u4E49\u7D22\u5F15\u5217\u8868

\n

\u53EF\u4EE5\u901A\u8FC7 index-list \u5C5E\u6027\u81EA\u5B9A\u4E49\u5C55\u793A\u7684\u7D22\u5F15\u5B57\u7B26\u5217\u8868\u3002

\n
<van-index-bar :index-list="indexList">\n  <van-index-anchor index="1">\u6807\u98981</van-index-anchor>\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n\n  <van-index-anchor index="2">\u6807\u98982</van-index-anchor>\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n  <van-cell title="\u6587\u672C" />\n\n  ...\n</van-index-bar>\n
\n
export default {\n  setup() {\n    return {\n      indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n    };\n  },\n};\n
\n

API

\n

IndexBar Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
index-list\u7D22\u5F15\u5B57\u7B26\u5217\u8868(string | number)[]A-Z
z-indexz-index \u5C42\u7EA7number | string1
sticky\u662F\u5426\u5F00\u542F\u951A\u70B9\u81EA\u52A8\u5438\u9876booleantrue
sticky-offset-top\u951A\u70B9\u81EA\u52A8\u5438\u9876\u65F6\u4E0E\u9876\u90E8\u7684\u8DDD\u79BBnumber0
highlight-color\u7D22\u5F15\u5B57\u7B26\u9AD8\u4EAE\u989C\u8272string#1989fa
teleport\u6307\u5B9A\u7D22\u5F15\u680F\u6302\u8F7D\u7684\u8282\u70B9string | Element-
\n

IndexAnchor Props

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53C2\u6570\u8BF4\u660E\u7C7B\u578B\u9ED8\u8BA4\u503C
index\u7D22\u5F15\u5B57\u7B26number | string-
\n

IndexBar Events

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u4E8B\u4EF6\u540D\u8BF4\u660E\u56DE\u8C03\u53C2\u6570
select\u70B9\u51FB\u7D22\u5F15\u680F\u7684\u5B57\u7B26\u65F6\u89E6\u53D1index: number | string
change\u5F53\u524D\u9AD8\u4EAE\u7684\u7D22\u5F15\u5B57\u7B26\u53D8\u5316\u65F6\u89E6\u53D1index: number | string
\n

IndexBar \u65B9\u6CD5

\n

\u901A\u8FC7 ref \u53EF\u4EE5\u83B7\u53D6\u5230 IndexBar \u5B9E\u4F8B\u5E76\u8C03\u7528\u5B9E\u4F8B\u65B9\u6CD5\uFF0C\u8BE6\u89C1\u7EC4\u4EF6\u5B9E\u4F8B\u65B9\u6CD5\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u65B9\u6CD5\u540D\u8BF4\u660E\u53C2\u6570\u8FD4\u56DE\u503C
scrollTo\u6EDA\u52A8\u5230\u6307\u5B9A\u951A\u70B9index: number | string-
\n

\u7C7B\u578B\u5B9A\u4E49

\n

\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A

\n
import type { IndexBarProps, IndexAnchorProps, IndexBarInstance } from 'vant';\n
\n

IndexBarInstance \u662F\u7EC4\u4EF6\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u7528\u6CD5\u5982\u4E0B\uFF1A

\n
import { ref } from 'vue';\nimport type { IndexBarInstance } from 'vant';\n\nconst indexBarRef = ref<IndexBarInstance>();\n\nindexBarRef.value?.scrollTo('B');\n
\n

IndexAnchor Slots

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u8BF4\u660E
default\u951A\u70B9\u4F4D\u7F6E\u663E\u793A\u5185\u5BB9\uFF0C\u9ED8\u8BA4\u4E3A\u7D22\u5F15\u5B57\u7B26
\n

\u4E3B\u9898\u5B9A\u5236

\n

\u6837\u5F0F\u53D8\u91CF

\n

\u7EC4\u4EF6\u63D0\u4F9B\u4E86\u4E0B\u5217 CSS \u53D8\u91CF\uFF0C\u53EF\u7528\u4E8E\u81EA\u5B9A\u4E49\u6837\u5F0F\uFF0C\u4F7F\u7528\u65B9\u6CD5\u8BF7\u53C2\u8003 ConfigProvider \u7EC4\u4EF6\u3002

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u540D\u79F0\u9ED8\u8BA4\u503C\u63CF\u8FF0
--van-index-bar-sidebar-z-index2-
--van-index-bar-index-font-sizevar(--van-font-size-xs)-
--van-index-bar-index-line-heightvar(--van-line-height-xs)-
--van-index-bar-index-active-colorvar(--van-primary-color)-
--van-index-anchor-z-index1-
--van-index-anchor-padding0 var(--van-padding-md)-
--van-index-anchor-text-colorvar(--van-text-color)-
--van-index-anchor-font-weightvar(--van-font-bold)-
--van-index-anchor-font-sizevar(--van-font-size-md)-
--van-index-anchor-line-height32px-
--van-index-anchor-backgroundtransparent-
--van-index-anchor-sticky-text-colorvar(--van-primary-color)-
--van-index-anchor-sticky-backgroundvar(--van-background-2)-
\n
'},null,8,l))}}}]);