fix(plugin-fm): drawer form values (#1259)

This commit is contained in:
Junyi 2022-12-16 23:41:38 -08:00 committed by GitHub
parent 9285a8b6a2
commit 9e9688fa5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,6 @@ const schema = {
type: 'string',
'x-decorator': 'FormItem',
'x-component': 'Input',
default: 'uploads',
},
path: {
title: '{{t("Path")}}',
@ -143,14 +142,12 @@ export const StorageOptions = observer((props) => {
const field = useField<Field>();
const [s, setSchema] = useState(new Schema({}));
useEffect(() => {
form.clearFormGraph('options.*');
// form.clearFormGraph('options.*');
setSchema(new Schema(schema[form.values.type] || {}));
}, [form.values.type]);
return (
<div>
<FormLayout layout={'vertical'}>
<RecursionField key={form.values.type || 'local'} basePath={field.address} onlyRenderProperties schema={s} />
</FormLayout>
</div>
<FormLayout layout={'vertical'}>
<RecursionField key={form.values.type || 'local'} basePath={field.address} onlyRenderProperties schema={s} />
</FormLayout>
);
});