Skip to content

Commit

Permalink
fix: 微信小程序无法支持元素主动滚动 (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
zuolung and [email protected] authored Jul 1, 2022
1 parent 35568c3 commit 8a3881f
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 7,111 deletions.
32 changes: 0 additions & 32 deletions packages/vantui-doc/src/index-bar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,6 @@ function Demo() {
}
```

### 弹窗用法

设置`widthPopup`后弹窗展示,位置固定在右侧,与非弹窗模式滚动位置稍有不同。弹窗内容宽度默认`70vw`,可以通过`popupClassName``popupStyle`来定义弹窗样式

```jsx
const arr = []
const charCodeOfA = 'A'.charCodeAt(0)
for (let i = 0; i < 26; i++) {
arr.push(String.fromCharCode(charCodeOfA + i))
}
function Demo() {
const [show, setShow] = react.useState(false)
return (
<>
<Button type="primary" onClick={() => setShow(true)}>
弹出内容
</Button>
<IndexBar widthPopup show={show} onClose={() => setShow(false)}>
{arr.map((item) => (
<Block key={item.item}>
<IndexAnchor index={item}></IndexAnchor>
<Cell title="文本"></Cell>
<Cell title="文本"></Cell>
<Cell title="文本"></Cell>
</Block>
))}
</IndexBar>
</>
)
}
```

### 自定义索引列表

可以通过`indexList`属性自定义展示的索引字符列表。
Expand Down
2 changes: 1 addition & 1 deletion packages/vantui-doc/vant.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
pagePath: path.join(__dirname, '../vantui-demo/src/pages'),
configPath: path.join(__dirname, '../vantui-demo/src/config.json'),
appConfigPath: path.join(__dirname, '../vantui-demo/src/app.config.js'),
withTabPages: ['icon', 'power-scroll-view', 'index-bar'],
withTabPages: ['icon', 'power-scroll-view'],
},
title: '@antmjs/vantui',
logo: 'https://antm-js.gitee.io/resource/antmjs-vantui.jpg',
Expand Down
Loading

0 comments on commit 8a3881f

Please sign in to comment.