docs(IndexBar): add Q&A (#4459)

* docs(IndexBar): add Q&A

* docs(IndexBar): update doc
This commit is contained in:
nemo-shen 2021-09-07 10:05:43 +08:00 committed by GitHub
parent f2e52128c6
commit 583581fbee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,3 +105,12 @@ Page({
| 名称 | 说明 | | 名称 | 说明 |
| ---- | -------------------------------- | | ---- | -------------------------------- |
| - | 锚点位置显示内容,默认为索引字符 | | - | 锚点位置显示内容,默认为索引字符 |
## 常见问题
### 嵌套在滚动元素中 IndexAnchor 失效?
由于 `<IndexBar />` 内部使用 wx.pageScrollTo 滚动到指定位置,因此只支持页面级滚动,无法在滚动元素中嵌套使用,例如:`view` 使用 `overflow: scroll;` 或者 `scroll-view`
具体可查看[微信小程序文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/scroll/wx.pageScrollTo.html)。
历史issue: [#4252](https://github.com/youzan/vant-weapp/issues/4252)