iter(g96): 抽屉支持上下滑出方位
This commit is contained in:
@@ -22,7 +22,7 @@ export function drawer(props: DrawerProps, ...children: unknown[]): HTMLElement
|
||||
'aside',
|
||||
{
|
||||
class: `ua-drawer ua-drawer-${props.placement ?? 'right'}`,
|
||||
style: `width:${props.width ?? 320}px`,
|
||||
style: `${props.placement === 'top' || props.placement === 'bottom' ? 'height' : 'width'}:${props.width ?? 320}px`, // 上下滑出改高度
|
||||
role: 'dialog',
|
||||
'aria-labelledby': titleId,
|
||||
'aria-hidden': () => String(!props.open()),
|
||||
|
||||
@@ -343,8 +343,8 @@ export interface ModalProps {
|
||||
export interface DrawerProps {
|
||||
title: string; // 标题
|
||||
open: Signal<boolean>; // 开关信号:true 滑出 / false 收起
|
||||
placement?: 'left' | 'right'; // 滑出方向;缺省 right
|
||||
width?: number; // 面板宽度像素;缺省 320
|
||||
placement?: 'left' | 'right' | 'top' | 'bottom'; // 滑出方向;缺省 right
|
||||
width?: number; // 面板尺寸像素:左右滑出为宽度,上下滑出为高度;缺省 320
|
||||
footer?: unknown; // 底部操作区内容;缺省不渲染
|
||||
onClose?: () => void; // 关闭回调(遮罩 / × / Esc 触发)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user