iter(g40): 修表单双提交并支持 Enter 提交

This commit is contained in:
HIsheR
2026-10-26 11:51:41 +08:00
parent 78779d7bb6
commit d685f66527
8 changed files with 45 additions and 13 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import type { ButtonProps } from './types.js';
export function button(props: ButtonProps): HTMLElement {
return h(
'button',
{ class: `ua-btn ua-btn-${props.variant ?? 'primary'}`, disabled: props.disabled, onClick: props.onClick }, // false/undefined 移除属性,Signal 走响应式
{ class: `ua-btn ua-btn-${props.variant ?? 'primary'}`, type: props.type ?? 'button', disabled: props.disabled, onClick: props.onClick }, // 缺省 button:表单内不隐式提交
props.label,
);
}