perf: add truthProp util (#8522)
* perf: add TruthyProp util * chore: rename * chore: upd
This commit is contained in:
+9
-21
@@ -1,41 +1,29 @@
|
||||
import { PropType, CSSProperties, TeleportProps } from 'vue';
|
||||
import { UnknownProp } from '../utils';
|
||||
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,
|
||||
overlayClass: unknownProp,
|
||||
// Initial rendering animation
|
||||
transitionAppear: Boolean,
|
||||
// whether to show overlay
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// prevent body scroll
|
||||
lockScroll: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// whether to lazy render
|
||||
lazyRender: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// whether to close popup when overlay is clicked
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
closeOnClickOverlay: truthProp,
|
||||
};
|
||||
|
||||
export type PopupSharedPropKeys = Array<keyof typeof popupSharedProps>;
|
||||
|
||||
Reference in New Issue
Block a user