Skip to content

Commit

Permalink
🐛 修复userconfig选择框问题与二次打开不显示的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Nov 19, 2022
1 parent eb0031f commit 3504d8d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pages/components/UserConfigPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const UserConfigPanel: React.FC<{
const [visible, setVisible] = React.useState(true);
const [tab, setTab] = React.useState(Object.keys(userConfig)[0]);
useEffect(() => {
setTab(Object.keys(userConfig)[0]);
setVisible(true);
}, [script, userConfig]);
return (
Expand Down Expand Up @@ -132,7 +133,13 @@ const UserConfigPanel: React.FC<{
/>
);
case "checkbox":
return <Checkbox>{item.description}</Checkbox>;
return (
<Checkbox
defaultChecked={values[`${itemKey}.${key}`]}
>
{item.description}
</Checkbox>
);
case "select":
case "mult-select":
// eslint-disable-next-line no-case-declarations
Expand Down

0 comments on commit 3504d8d

Please sign in to comment.