Files
vant/src/popup/shared.ts
T
neverlandandGitHub bd609e1df0 perf: add truthProp util (#8522)
* perf: add TruthyProp util

* chore: rename

* chore: upd
2021-04-14 10:26:21 +08:00

34 lines
974 B
TypeScript

import { PropType, CSSProperties, TeleportProps } from 'vue';
import { truthProp, unknownProp } from '../utils';
export const popupSharedProps = {
// whether to show popup
show: Boolean,
// z-index
zIndex: [Number, String],
// whether to show overlay
overlay: truthProp,
// transition duration
duration: [Number, String],
// teleport
teleport: [String, Object] as PropType<TeleportProps['to']>,
// prevent body scroll
lockScroll: truthProp,
// whether to lazy render
lazyRender: truthProp,
// overlay custom style
overlayStyle: Object as PropType<CSSProperties>,
// overlay custom class name
overlayClass: unknownProp,
// Initial rendering animation
transitionAppear: Boolean,
// whether to close popup when overlay is clicked
closeOnClickOverlay: truthProp,
};
export type PopupSharedPropKeys = Array<keyof typeof popupSharedProps>;
export const popupSharedPropKeys = Object.keys(
popupSharedProps
) as PopupSharedPropKeys;