修正Switch组件使用Form传递内容的问题。
This commit is contained in:
parent
6396b257cb
commit
e2f78aefb3
|
@ -31,9 +31,7 @@ export function Switch({ name, checked = false, disabled = false, onChange }: Sw
|
|||
<div
|
||||
className={cx(styles.switch_handle, isChecked && styles.checked)}
|
||||
onClick={handleSwitch}></div>
|
||||
{!isNil(name) && (
|
||||
<input type="hidden" name={name} value={isChecked ? 'checked' : undefined} />
|
||||
)}
|
||||
{!isNil(name) && <input type="hidden" name={name} value={isChecked ? 'true' : 'false'} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user