iter(g40): 修表单双提交并支持 Enter 提交
This commit is contained in:
@@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user