Skip to content

Commit

Permalink
fix: fix useCrudSchemas not work
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Jul 1, 2022
1 parent f01c261 commit 0a855b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/Search/src/Search.vue
Expand Up @@ -31,7 +31,8 @@ const props = defineProps({
// 是否显示伸缩
expand: propTypes.bool.def(false),
// 伸缩的界限字段
expandField: propTypes.string.def('')
expandField: propTypes.string.def(''),
inline: propTypes.bool.def(true)
})
const emit = defineEmits(['search', 'reset'])
Expand Down Expand Up @@ -96,7 +97,7 @@ const setVisible = () => {
:is-custom="false"
:label-width="labelWidth"
hide-required-asterisk
inline
:inline="inline"
:is-col="isCol"
:schema="newSchema"
@register="register"
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/web/useCrudSchemas.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -211,7 +211,7 @@ const filterFormSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): For
for (const task of formRequestTask) {
task()
}

console.log(formSchema)
return formSchema
}

Expand Down
3 changes: 3 additions & 0 deletions src/views/Example/Dialog/ExampleDialog.vue
Expand Up @@ -90,6 +90,9 @@ const crudSchemas = reactive<CrudSchema[]>([
form: {
component: 'Select',
componentProps: {
style: {
width: '100%'
},
options: [
{
label: '重要',
Expand Down

0 comments on commit 0a855b9

Please sign in to comment.