Skip to content

Commit

Permalink
Merge pull request #349 from laipz/dev-Descriptions
Browse files Browse the repository at this point in the history
fix(Descriptions): Add a default value
  • Loading branch information
kailong321200875 committed Oct 6, 2023
2 parents 5ddfb4d + 83b09f0 commit f7357f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/Descriptions/src/Descriptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('descriptions')
const defaultData = '-'
export default defineComponent({
name: 'Descriptions',
props: {
Expand Down Expand Up @@ -115,7 +117,7 @@ export default defineComponent({
default: () =>
item.slots?.default
? item.slots?.default(props.data)
: get(props.data, item.field)
: get(props.data, item.field) ?? defaultData
}}
</ElDescriptionsItem>
)
Expand Down

0 comments on commit f7357f5

Please sign in to comment.