From e343eab0f277af8a3dba7538240e589aab25fa90 Mon Sep 17 00:00:00 2001
From: * <8>
Date: Mon, 9 May 2022 16:47:25 +0800
Subject: [PATCH] Match-id-2a32f3df93794ac555089f7efbae08d7c1ed6676
---
.../src/components/ComponentInfo.tsx | 25 +++++++++++++++----
1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/libs/extension/src/components/ComponentInfo.tsx b/libs/extension/src/components/ComponentInfo.tsx
index 328642bd..b3b09d4a 100644
--- a/libs/extension/src/components/ComponentInfo.tsx
+++ b/libs/extension/src/components/ComponentInfo.tsx
@@ -70,9 +70,9 @@ function ComponentAttr({ attrsName, attrsType, attrs, id }: {
{hasChild && }
{`${item.name}`}
{' :'}
- {item.type === 'string' || item.type === 'number' ? (
- {
const nextAttrs = [...editableAttrs];
@@ -93,8 +93,23 @@ function ComponentAttr({ attrsName, attrsType, attrs, id }: {
}
}}
/>
- ) : (
- {item.value}
+ : (item.type === 'boolean'
+ ? {
+ const nextAttrs = [...editableAttrs];
+ const nextItem = {...item};
+ nextItem.value = event.target.checked;
+ nextAttrs[index] = nextItem;
+ setEditableAttrs(nextAttrs);
+ if (!isDev) {
+ const data = buildAttrModifyData(attrsType,attrs, nextItem.value,item, index, id);
+ postMessageToBackground(ModifyAttrs, data);
+ }
+ }}/>
+ : {item.value}
)}
);