mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-05 19:41:42 +08:00
feat(ShareSheet): add overlay-style、overlay-class prop (#8225)
This commit is contained in:
parent
87b6654900
commit
2c2cd104c9
@ -169,6 +169,8 @@ export default {
|
|||||||
| description | Description | _string_ | - |
|
| description | Description | _string_ | - |
|
||||||
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
|
| duration | Transition duration, unit second | _number \| string_ | `0.3` |
|
||||||
| overlay | Whether to show overlay | _boolean_ | `true` |
|
| overlay | Whether to show overlay | _boolean_ | `true` |
|
||||||
|
| overlay-class | Custom overlay class | _string \| Array \| object_ | - |
|
||||||
|
| overlay-style | Custom overlay style | _object_ | - |
|
||||||
| lock-scroll | Whether to lock background scroll | _boolean_ | `true` |
|
| lock-scroll | Whether to lock background scroll | _boolean_ | `true` |
|
||||||
| lazy-render | Whether to lazy render util appeared | _boolean_ | `true` |
|
| lazy-render | Whether to lazy render util appeared | _boolean_ | `true` |
|
||||||
| close-on-popstate | Whether to close when popstate | _boolean_ | `true` |
|
| close-on-popstate | Whether to close when popstate | _boolean_ | `true` |
|
||||||
|
@ -185,6 +185,8 @@ export default {
|
|||||||
| description | 标题下方的辅助描述文字 | _string_ | - |
|
| description | 标题下方的辅助描述文字 | _string_ | - |
|
||||||
| duration | 动画时长,单位秒 | _number \| string_ | `0.3` |
|
| duration | 动画时长,单位秒 | _number \| string_ | `0.3` |
|
||||||
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
| overlay | 是否显示遮罩层 | _boolean_ | `true` |
|
||||||
|
| overlay-class | 自定义遮罩层类名 | _string \| Array \| object_ | - |
|
||||||
|
| overlay-style | 自定义遮罩层样式 | _object_ | - |
|
||||||
| lock-scroll | 是否锁定背景滚动 | _boolean_ | `true` |
|
| lock-scroll | 是否锁定背景滚动 | _boolean_ | `true` |
|
||||||
| lazy-render | 是否在显示弹层时才渲染内容 | _boolean_ | `true` |
|
| lazy-render | 是否在显示弹层时才渲染内容 | _boolean_ | `true` |
|
||||||
| close-on-popstate | 是否在页面回退时自动关闭 | _boolean_ | `true` |
|
| close-on-popstate | 是否在页面回退时自动关闭 | _boolean_ | `true` |
|
||||||
|
@ -5,7 +5,7 @@ import { createNamespace, pick } from '../utils';
|
|||||||
|
|
||||||
// Components
|
// Components
|
||||||
import Popup from '../popup';
|
import Popup from '../popup';
|
||||||
import { popupSharedProps } from '../popup/shared';
|
import { popupSharedProps, popupSharedPropKeys } from '../popup/shared';
|
||||||
|
|
||||||
export type ShareSheetOption = {
|
export type ShareSheetOption = {
|
||||||
name: string;
|
name: string;
|
||||||
@ -27,6 +27,12 @@ const PRESET_ICONS = [
|
|||||||
'wechat-moments',
|
'wechat-moments',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const popupKeys = [
|
||||||
|
...popupSharedPropKeys,
|
||||||
|
'closeOnPopstate',
|
||||||
|
'safeAreaInsetBottom',
|
||||||
|
] as const;
|
||||||
|
|
||||||
function getIconURL(icon: string) {
|
function getIconURL(icon: string) {
|
||||||
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
if (PRESET_ICONS.indexOf(icon) !== -1) {
|
||||||
return `https://img01.yzcdn.cn/vant/share-sheet-${icon}.png`;
|
return `https://img01.yzcdn.cn/vant/share-sheet-${icon}.png`;
|
||||||
@ -141,17 +147,7 @@ export default createComponent({
|
|||||||
class={bem()}
|
class={bem()}
|
||||||
position="bottom"
|
position="bottom"
|
||||||
{...{
|
{...{
|
||||||
...pick(props, [
|
...pick(props, popupKeys),
|
||||||
'show',
|
|
||||||
'overlay',
|
|
||||||
'duration',
|
|
||||||
'teleport',
|
|
||||||
'lazyRender',
|
|
||||||
'lockScroll',
|
|
||||||
'closeOnPopstate',
|
|
||||||
'closeOnClickOverlay',
|
|
||||||
'safeAreaInsetBottom',
|
|
||||||
]),
|
|
||||||
'onUpdate:show': toggle,
|
'onUpdate:show': toggle,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user