From 42d5c7d28fdc9aa8dd96f9e6cc6a7fd1a0bc211f Mon Sep 17 00:00:00 2001 From: Vixalie Date: Tue, 12 Aug 2025 22:38:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor(components):=20=E4=BC=98=E5=8C=96=20Ra?= =?UTF-8?q?dio=20=E7=BB=84=E4=BB=B6=E7=9A=84=E7=A6=81=E7=94=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改了 Radio 组件的选中图标,在禁用状态下使用中性颜色 - 通过传递 disabled 属性来控制图标的颜色 - 优化了代码结构,提高了组件的可维护性 --- src/components/Radio.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/Radio.tsx b/src/components/Radio.tsx index 5a90d21..57074bc 100644 --- a/src/components/Radio.tsx +++ b/src/components/Radio.tsx @@ -20,7 +20,13 @@ interface RadioProps { const RadioIcon = [ () => , - () => , + (props) => ( + + ), ]; const Radio: ParentComponent = (props) => { @@ -53,7 +59,7 @@ const Radio: ParentComponent = (props) => { class="flex flex-row items-center gap-1 cursor-pointer" classList={{ 'text-neutral': mProps.disabled }} onClick={handleClick}> - +
{mProps.children}