mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-08-18 02:00:10 +08:00
feat(Notify): add lockScroll option (#8168)
This commit is contained in:
parent
8568c02e0b
commit
f7b09d1677
@ -13,6 +13,7 @@ export default createComponent({
|
|||||||
message: [Number, String],
|
message: [Number, String],
|
||||||
className: UnknownProp,
|
className: UnknownProp,
|
||||||
background: String,
|
background: String,
|
||||||
|
lockScroll: Boolean,
|
||||||
type: {
|
type: {
|
||||||
type: String as PropType<NotifyType>,
|
type: String as PropType<NotifyType>,
|
||||||
default: 'danger',
|
default: 'danger',
|
||||||
@ -34,7 +35,7 @@ export default createComponent({
|
|||||||
overlay={false}
|
overlay={false}
|
||||||
position="top"
|
position="top"
|
||||||
duration={0.2}
|
duration={0.2}
|
||||||
lockScroll={false}
|
lockScroll={props.lockScroll}
|
||||||
>
|
>
|
||||||
{slots.default ? slots.default() : props.message}
|
{slots.default ? slots.default() : props.message}
|
||||||
</Popup>
|
</Popup>
|
||||||
|
@ -107,6 +107,7 @@ export default {
|
|||||||
| color | Message color | _string_ | `white` | |
|
| color | Message color | _string_ | `white` | |
|
||||||
| background | Background color | _string_ | - |
|
| background | Background color | _string_ | - |
|
||||||
| className | Custom className | _string \| Array \| object_ | - |
|
| className | Custom className | _string \| Array \| object_ | - |
|
||||||
|
| lockScroll `v3.0.7` | Whether to lock background scroll | _boolean_ | `false` |
|
||||||
| onClick | Callback function after click | _(event: MouseEvent) => void_ | - |
|
| onClick | Callback function after click | _(event: MouseEvent) => void_ | - |
|
||||||
| onOpened | Callback function after opened | _() => void_ | - |
|
| onOpened | Callback function after opened | _() => void_ | - |
|
||||||
| onClose | Callback function after close | _() => void_ | - |
|
| onClose | Callback function after close | _() => void_ | - |
|
||||||
|
@ -144,6 +144,7 @@ export default {
|
|||||||
| color | 字体颜色 | _string_ | `white` |
|
| color | 字体颜色 | _string_ | `white` |
|
||||||
| background | 背景颜色 | _string_ | - |
|
| background | 背景颜色 | _string_ | - |
|
||||||
| className | 自定义类名 | _string \| Array \| object_ | - |
|
| className | 自定义类名 | _string \| Array \| object_ | - |
|
||||||
|
| lockScroll `v3.0.7` | 是否锁定背景滚动 | _boolean_ | `false` |
|
||||||
| onClick | 点击时的回调函数 | _(event: MouseEvent): void_ | - |
|
| onClick | 点击时的回调函数 | _(event: MouseEvent): void_ | - |
|
||||||
| onOpened | 完全展示后的回调函数 | _() => void_ | - |
|
| onOpened | 完全展示后的回调函数 | _() => void_ | - |
|
||||||
| onClose | 关闭时的回调函数 | _() => void_ | - |
|
| onClose | 关闭时的回调函数 | _() => void_ | - |
|
||||||
|
@ -15,6 +15,7 @@ export type NotifyOptions = {
|
|||||||
duration?: number;
|
duration?: number;
|
||||||
className?: unknown;
|
className?: unknown;
|
||||||
background?: string;
|
background?: string;
|
||||||
|
lockScroll?: boolean;
|
||||||
onClick?: (event: MouseEvent) => void;
|
onClick?: (event: MouseEvent) => void;
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
onOpened?: () => void;
|
onOpened?: () => void;
|
||||||
@ -74,6 +75,7 @@ function defaultOptions() {
|
|||||||
onOpened: undefined,
|
onOpened: undefined,
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
className: '',
|
className: '',
|
||||||
|
lockScroll: false,
|
||||||
background: undefined,
|
background: undefined,
|
||||||
} as NotifyOptions;
|
} as NotifyOptions;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user