iter: d02 select/radioGroup 补 disabled + 修复 select 箭头旋转
This commit is contained in:
@@ -6,7 +6,12 @@ export function radioGroup(props: RadioGroupProps): HTMLElement {
|
||||
const groupName = `ua-radio-${Math.random().toString(36).slice(2, 8)}`; // 组内唯一 name
|
||||
const radios: HTMLInputElement[] = [];
|
||||
for (const opt of props.options) {
|
||||
const input = h('input', { type: 'radio', name: groupName, class: 'ua-radio' }) as HTMLInputElement;
|
||||
const input = h('input', {
|
||||
type: 'radio',
|
||||
name: groupName,
|
||||
class: 'ua-radio',
|
||||
disabled: props.disabled, // 布尔或信号禁用,h() 直接透传
|
||||
}) as HTMLInputElement;
|
||||
input.value = opt.value;
|
||||
radios.push(input);
|
||||
input.addEventListener('change', () => {
|
||||
|
||||
Reference in New Issue
Block a user