mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(Toast): add clickOnClickOverlay option (#4967)
This commit is contained in:
parent
05c2df8e6a
commit
b055980fe0
@ -146,6 +146,7 @@ Toast.resetDefaultOptions('loading');
|
||||
| mask | Whether to show mask | *boolean* | `false` | - |
|
||||
| forbidClick | Whether to forbid click background | *boolean* | `false` | - |
|
||||
| closeOnClick | Whether to close after clicked | *boolean* | `false` | 2.1.5 |
|
||||
| closeOnClickOverlay | Whether to close when click overlay | *boolean* | `false` | 2.2.13 |
|
||||
| loadingType | Loading icon type, can be set to `spinner` | *string* | `circular` | - |
|
||||
| duration | Toast duration(ms), won't disappear if value is 0 | *number* | `2000` | - |
|
||||
| className | Custom className | *any* | - | - |
|
||||
|
@ -149,6 +149,7 @@ Toast.resetDefaultOptions('loading');
|
||||
| mask | 是否显示背景遮罩层 | *boolean* | `false` | - |
|
||||
| forbidClick | 是否禁止背景点击 | *boolean* | `false` | - |
|
||||
| closeOnClick | 是否在点击后关闭 | *boolean* | `false` | 2.1.5 |
|
||||
| closeOnClickOverlay | 是否在点击遮罩层后关闭 | *boolean* | `false` | 2.2.13 |
|
||||
| loadingType | 加载图标类型, 可选值为 `spinner` | *string* | `circular` | - |
|
||||
| duration | 展示时长(ms),值为 0 时,toast 不会消失 | *number* | `2000` | - |
|
||||
| className | 自定义类名 | *any* | - | - |
|
||||
|
@ -19,7 +19,8 @@ const defaultOptions = {
|
||||
loadingType: undefined,
|
||||
getContainer: 'body',
|
||||
overlayStyle: null,
|
||||
closeOnClick: false
|
||||
closeOnClick: false,
|
||||
closeOnClickOverlay: false
|
||||
};
|
||||
|
||||
// default options of specific type
|
||||
|
1
types/toast.d.ts
vendored
1
types/toast.d.ts
vendored
@ -17,6 +17,7 @@ export type ToastOptions = {
|
||||
loadingType?: string;
|
||||
forbidClick?: boolean;
|
||||
closeOnClick?: boolean;
|
||||
closeOnClickOverlay?: boolean;
|
||||
getContainer?: string | (() => Element);
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user