Skip to content

Commit

Permalink
fix: 修复 property 组件在初始无数据时报错问题 (#2628)
Browse files Browse the repository at this point in the history
  • Loading branch information
吴多益 authored Sep 29, 2021
1 parent 082edb6 commit 2fdbf5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/zh-CN/components/property.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ order: 60
},
"body": {
"type": "property",
"source": "items"
"source": "${items}"
}
}
```
Expand Down
7 changes: 4 additions & 3 deletions src/renderers/Property.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ export default class Property extends React.Component<PropertyProps, object> {
prepareRows() {
const {column = 3, items, source, data} = this.props;

const propertyItems = items
? items
: (resolveVariable(source, data) as Array<PropertyItem>);
const propertyItems =
(items
? items
: (resolveVariable(source, data) as Array<PropertyItem>)) || [];

const rows: PropertyContent[][] = [];

Expand Down

0 comments on commit 2fdbf5d

Please sign in to comment.