feat(components): 为 Check 和 Radio 组件添加禁用状态样式
- 在 Check 和 Radio 组件的父容器上添加 classList 属性 - 根据 mProps.disabled 的值动态设置 'text-neutral' 类 - 优化组件结构,提高可读性和可维护性
This commit is contained in:
@@ -49,7 +49,10 @@ const Check: ParentComponent<CheckBoxProps> = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="flex flex-row items-center gap-1 cursor-pointer" onClick={handleClick}>
|
||||
<div
|
||||
class="flex flex-row items-center gap-1 cursor-pointer"
|
||||
classList={{ 'text-neutral': mProps.disabled }}
|
||||
onClick={handleClick}>
|
||||
<Dynamic component={CheckIcon[internalChecked() ? 1 : 0]} />
|
||||
<div>{mProps.children}</div>
|
||||
<Show when={isNotNil(mProps.name)}>
|
||||
|
@@ -49,7 +49,10 @@ const Radio: ParentComponent<RadioProps> = (props) => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div class="flex flex-row items-center gap-1 cursor-pointer" onClick={handleClick}>
|
||||
<div
|
||||
class="flex flex-row items-center gap-1 cursor-pointer"
|
||||
classList={{ 'text-neutral': mProps.disabled }}
|
||||
onClick={handleClick}>
|
||||
<Dynamic component={RadioIcon[internalChecked() ? 1 : 0]} />
|
||||
<div>{mProps.children}</div>
|
||||
<Show when={isNotNil(mProps.name)}>
|
||||
|
Reference in New Issue
Block a user