Skip to content

Commit

Permalink
fix: fix collapse and tab props error (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyunwan authored Oct 13, 2023
1 parent 4368418 commit be653bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/components/src/form-collapse/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,14 @@ const usePanels = () => {
const field = collapseField.query(collapseField.address.concat(name)).take()
if (field?.display === 'none' || field?.display === 'hidden') return
if (schema['x-component']?.indexOf('CollapsePanel') > -1) {
const key =
field?.componentProps?.key || schema?.['x-component-props']?.key || name
panels.push({
name,
props: {
...schema?.['x-component-props'],
key: schema?.['x-component-props']?.key || name,
...field?.componentProps,
key,
},
schema,
})
Expand Down
5 changes: 4 additions & 1 deletion packages/components/src/form-tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,14 @@ const useTabs = () => {
const field = tabsField.query(tabsField.address.concat(name)).take()
if (field?.display === 'none' || field?.display === 'hidden') return
if (schema['x-component']?.indexOf('TabPane') > -1) {
const key =
field?.componentProps?.key || schema?.['x-component-props']?.key || name
tabs.push({
name,
props: {
key: schema?.['x-component-props']?.key || name,
...schema?.['x-component-props'],
...field?.componentProps,
key,
},
schema,
})
Expand Down

0 comments on commit be653bd

Please sign in to comment.