mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-09-29 21:59:57 +08:00
parent
107782364a
commit
5479631403
@ -103,6 +103,22 @@ Page({
|
|||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 常见问题
|
||||||
|
|
||||||
|
### 组件滚动穿透该怎么解决?
|
||||||
|
|
||||||
|
使用组件时,会发现内容部分滚动到底时,继续划动会导致页面的滚动,这就是滚动穿透。
|
||||||
|
|
||||||
|
在web中,可以通过给 body 增加样式或者劫持内容部分的 `touchstart` 事件,判断后动态调用 `preventDefault` 来实现。不幸的是,这两种方法在小程序中都是不可行的,组件内部无法很好地处理滚动穿透问题。
|
||||||
|
|
||||||
|
如果你有禁止滚动的需要,可以显式地 `catch` 组件的 `touchstart` 事件,不过需要注意的是,这也会禁止组件内容部分的滚动。
|
||||||
|
```html
|
||||||
|
<van-popup
|
||||||
|
...
|
||||||
|
catch:touchstart
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
|
Loading…
x
Reference in New Issue
Block a user