iter: d11 modal 补 size 档位与 footer 操作区

This commit is contained in:
ui-arch-bot
2026-10-23 16:54:36 +08:00
parent a08f157e5e
commit d1a2864470
10 changed files with 76 additions and 12 deletions
+2 -1
View File
@@ -16,9 +16,10 @@ export function modal(props: ModalProps, ...children: unknown[]): HTMLElement {
});
const box = h(
'div',
{ class: 'ua-modal' },
{ class: `ua-modal ua-modal-${props.size ?? 'md'}` },
h('div', { class: 'ua-modal-head' }, h('h3', { class: 'ua-modal-title' }, props.title), h('button', { class: 'ua-modal-close', onClick: close }, '×')),
h('div', { class: 'ua-modal-body' }, ...children),
props.footer ? h('div', { class: 'ua-modal-foot' }, props.footer) : null, // 底部操作区:右对齐,仅传了才渲染
);
overlay.append(box);
effect(() => {
+2
View File
@@ -213,6 +213,8 @@ export interface TabsProps {
export interface ModalProps {
title: string; // 标题
open: Signal<boolean>; // 开关信号:true 显示 / false 隐藏
size?: 'sm' | 'md' | 'lg'; // 宽度档位;缺省 md(420px),sm 340px / lg 640px
footer?: unknown; // 底部操作区内容(常见为按钮组);缺省不渲染
onClose?: () => void; // 关闭回调(点遮罩、× 或 Esc 触发)
}