fix: fix useCrudSchemas not work

This commit is contained in:
kailong321200875
2022-07-01 22:16:41 +08:00
parent f01c261647
commit 0a855b93e2
3 changed files with 9 additions and 5 deletions

View File

@@ -169,10 +169,10 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
eachTree(crudSchema, (schemaItem: CrudSchema) => {
// 判断是否显示
if (schemaItem?.form?.show) {
if (schemaItem?.form?.show !== false) {
const formSchemaItem = {
// 默认为 input
component: schemaItem.form.component || 'Input',
component: schemaItem?.form?.component || 'Input',
componentProps: {},
...schemaItem.form,
field: schemaItem.field,
@@ -211,7 +211,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
for (const task of formRequestTask) {
task()
}
console.log(formSchema)
return formSchema
}