-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
131 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import getPrefixCls from '../_util/getPrefixCls'; | ||
|
||
export const prefixCls = getPrefixCls('drawer'); | ||
|
||
export const COMPONENT_NAME = 'FDrawer'; | ||
|
||
/** 抽屉拖拽时,最小的尺寸 */ | ||
export const DRAWER_MIN_SIZE = 200; | ||
/** 抽屉拖拽时,距离浏览器窗口边缘的最小距离 */ | ||
export const DRAWER_CLIENT_MAX_SPACE = 100; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { type PropType, type ComponentObjectPropsOptions } from 'vue'; | ||
import type { ExtractPublicPropTypes } from '../_util/interface'; | ||
|
||
export type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left'; | ||
|
||
// 通用的属性 | ||
export const drawerProps = { | ||
show: Boolean, | ||
displayDirective: { | ||
type: String as PropType<'show' | 'if'>, | ||
default: 'show', | ||
}, | ||
closable: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
mask: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
maskClosable: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
title: String, | ||
okText: { | ||
type: String, | ||
default: '确定', | ||
}, | ||
okLoading: Boolean, | ||
cancelText: { | ||
type: String, | ||
default: '取消', | ||
}, | ||
showCancel: { | ||
type: Boolean, | ||
default: true, | ||
}, | ||
width: { | ||
type: [String, Number] as PropType<string | number>, | ||
default: 520, | ||
}, | ||
height: { | ||
type: [String, Number] as PropType<string | number>, | ||
default: 520, | ||
}, | ||
footer: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
footerBorder: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
getContainer: { | ||
type: Function, | ||
}, | ||
placement: { | ||
type: String as PropType<DrawerPlacement>, | ||
default: 'right' satisfies DrawerPlacement, | ||
}, | ||
contentClass: String, | ||
resizable: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
} as const satisfies ComponentObjectPropsOptions; | ||
|
||
export type DrawerProps = ExtractPublicPropTypes<typeof drawerProps>; | ||
|
||
export const UPDATE_SHOW_EVENT = 'update:show'; | ||
export const OK_EVENT = 'ok'; | ||
export const CANCEL_EVENT = 'cancel'; | ||
export const AFTER_LEAVE_EVENT = 'after-leave'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters