/*! 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:'
\u7528\u4E8E\u5217\u8868\u7684\u7D22\u5F15\u5206\u7C7B\u663E\u793A\u548C\u5FEB\u901F\u5B9A\u4F4D\u3002
\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
\nimport { createApp } from 'vue';\nimport { IndexBar, IndexAnchor } from 'vant';\n\nconst app = createApp();\napp.use(IndexBar);\napp.use(IndexAnchor);\n
\n\u70B9\u51FB\u7D22\u5F15\u680F\u65F6\uFF0C\u4F1A\u81EA\u52A8\u8DF3\u8F6C\u5230\u5BF9\u5E94\u7684 IndexAnchor
\u951A\u70B9\u4F4D\u7F6E\u3002
<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\u53EF\u4EE5\u901A\u8FC7 index-list
\u5C5E\u6027\u81EA\u5B9A\u4E49\u5C55\u793A\u7684\u7D22\u5F15\u5B57\u7B26\u5217\u8868\u3002
<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
\nexport default {\n setup() {\n return {\n indexList: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],\n };\n },\n};\n
\n\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
index-list | \n\u7D22\u5F15\u5B57\u7B26\u5217\u8868 | \n(string | number)[] | \nA-Z | \n
z-index | \nz-index \u5C42\u7EA7 | \nnumber | string | \n1 | \n
sticky | \n\u662F\u5426\u5F00\u542F\u951A\u70B9\u81EA\u52A8\u5438\u9876 | \nboolean | \ntrue | \n
sticky-offset-top | \n\u951A\u70B9\u81EA\u52A8\u5438\u9876\u65F6\u4E0E\u9876\u90E8\u7684\u8DDD\u79BB | \nnumber | \n0 | \n
highlight-color | \n\u7D22\u5F15\u5B57\u7B26\u9AD8\u4EAE\u989C\u8272 | \nstring | \n#1989fa | \n
teleport | \n\u6307\u5B9A\u7D22\u5F15\u680F\u6302\u8F7D\u7684\u8282\u70B9 | \nstring | Element | \n- | \n
\u53C2\u6570 | \n\u8BF4\u660E | \n\u7C7B\u578B | \n\u9ED8\u8BA4\u503C | \n
---|---|---|---|
index | \n\u7D22\u5F15\u5B57\u7B26 | \nnumber | string | \n- | \n
\u4E8B\u4EF6\u540D | \n\u8BF4\u660E | \n\u56DE\u8C03\u53C2\u6570 | \n
---|---|---|
select | \n\u70B9\u51FB\u7D22\u5F15\u680F\u7684\u5B57\u7B26\u65F6\u89E6\u53D1 | \nindex: number | string | \n
change | \n\u5F53\u524D\u9AD8\u4EAE\u7684\u7D22\u5F15\u5B57\u7B26\u53D8\u5316\u65F6\u89E6\u53D1 | \nindex: number | string | \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\u65B9\u6CD5\u540D | \n\u8BF4\u660E | \n\u53C2\u6570 | \n\u8FD4\u56DE\u503C | \n
---|---|---|---|
scrollTo | \n\u6EDA\u52A8\u5230\u6307\u5B9A\u951A\u70B9 | \nindex: number | string | \n- | \n
\u7EC4\u4EF6\u5BFC\u51FA\u4EE5\u4E0B\u7C7B\u578B\u5B9A\u4E49\uFF1A
\nimport type { IndexBarProps, IndexAnchorProps, IndexBarInstance } from 'vant';\n
\nIndexBarInstance
\u662F\u7EC4\u4EF6\u5B9E\u4F8B\u7684\u7C7B\u578B\uFF0C\u7528\u6CD5\u5982\u4E0B\uFF1A
import { ref } from 'vue';\nimport type { IndexBarInstance } from 'vant';\n\nconst indexBarRef = ref<IndexBarInstance>();\n\nindexBarRef.value?.scrollTo('B');\n
\n\u540D\u79F0 | \n\u8BF4\u660E | \n
---|---|
default | \n\u951A\u70B9\u4F4D\u7F6E\u663E\u793A\u5185\u5BB9\uFF0C\u9ED8\u8BA4\u4E3A\u7D22\u5F15\u5B57\u7B26 | \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\u540D\u79F0 | \n\u9ED8\u8BA4\u503C | \n\u63CF\u8FF0 | \n
---|---|---|
--van-index-bar-sidebar-z-index | \n2 | \n- | \n
--van-index-bar-index-font-size | \nvar(--van-font-size-xs) | \n- | \n
--van-index-bar-index-line-height | \nvar(--van-line-height-xs) | \n- | \n
--van-index-bar-index-active-color | \nvar(--van-primary-color) | \n- | \n
--van-index-anchor-z-index | \n1 | \n- | \n
--van-index-anchor-padding | \n0 var(--van-padding-md) | \n- | \n
--van-index-anchor-text-color | \nvar(--van-text-color) | \n- | \n
--van-index-anchor-font-weight | \nvar(--van-font-bold) | \n- | \n
--van-index-anchor-font-size | \nvar(--van-font-size-md) | \n- | \n
--van-index-anchor-line-height | \n32px | \n- | \n
--van-index-anchor-background | \ntransparent | \n- | \n
--van-index-anchor-sticky-text-color | \nvar(--van-primary-color) | \n- | \n
--van-index-anchor-sticky-background | \nvar(--van-background-2) | \n- | \n