mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(FloatingPanel): add lock-scroll prop (#12157)
* feat(FloatingPanel): add lockScroll prop * docs: improve description
This commit is contained in:
parent
cfa33c2fa1
commit
b543c22c8b
@ -28,6 +28,7 @@ export const floatingPanelProps = {
|
|||||||
anchors: makeArrayProp<number>(),
|
anchors: makeArrayProp<number>(),
|
||||||
duration: makeNumericProp(0.2),
|
duration: makeNumericProp(0.2),
|
||||||
contentDraggable: truthProp,
|
contentDraggable: truthProp,
|
||||||
|
lockScroll: truthProp,
|
||||||
safeAreaInsetBottom: truthProp,
|
safeAreaInsetBottom: truthProp,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -135,7 +136,7 @@ export default defineComponent({
|
|||||||
{ immediate: true },
|
{ immediate: true },
|
||||||
);
|
);
|
||||||
|
|
||||||
useLockScroll(rootRef, () => true);
|
useLockScroll(rootRef, () => props.lockScroll);
|
||||||
|
|
||||||
// useEventListener will set passive to `false` to eliminate the warning of Chrome
|
// useEventListener will set passive to `false` to eliminate the warning of Chrome
|
||||||
useEventListener('touchmove', onTouchmove, { target: rootRef });
|
useEventListener('touchmove', onTouchmove, { target: rootRef });
|
||||||
|
@ -88,6 +88,7 @@ By default, both the header and content areas of FloatingPanel can be dragged, b
|
|||||||
| anchors | Setting custom anchors, unit `px` | _number[]_ | `[100, window.innerWidth * 0.6]` |
|
| anchors | Setting custom anchors, unit `px` | _number[]_ | `[100, window.innerWidth * 0.6]` |
|
||||||
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
|
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
|
||||||
| content-draggable | Allow dragging content | _boolean_ | `true` |
|
| content-draggable | Allow dragging content | _boolean_ | `true` |
|
||||||
|
| lock-scroll `v4.6.4` | Whether to lock background scroll | _boolean_ | `true` |
|
||||||
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
|
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
@ -88,6 +88,7 @@ export default {
|
|||||||
| anchors | 设置自定义锚点, 单位 `px` | _number[]_ | `[100, window.innerWidth * 0.6]` |
|
| anchors | 设置自定义锚点, 单位 `px` | _number[]_ | `[100, window.innerWidth * 0.6]` |
|
||||||
| duration | 动画时长,单位秒,设置为 0 可以禁用动画 | _number \| string_ | `0.3` |
|
| duration | 动画时长,单位秒,设置为 0 可以禁用动画 | _number \| string_ | `0.3` |
|
||||||
| content-draggable | 允许拖拽内容容器 | _boolean_ | `true` |
|
| content-draggable | 允许拖拽内容容器 | _boolean_ | `true` |
|
||||||
|
| lock-scroll `v4.6.4` | 是否锁定背景滚动 | _boolean_ | `true` |
|
||||||
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/advanced-usage#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
|
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/advanced-usage#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
|
||||||
|
|
||||||
### Events
|
### Events
|
||||||
|
Loading…
x
Reference in New Issue
Block a user