From 2fdbf5d2206014f199e939bc5b17fb0497e195a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=A4=9A=E7=9B=8A?= Date: Wed, 29 Sep 2021 15:55:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20property=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=9C=A8=E5=88=9D=E5=A7=8B=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98=20(#2628?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh-CN/components/property.md | 2 +- src/renderers/Property.tsx | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/zh-CN/components/property.md b/docs/zh-CN/components/property.md index da3844b8d..fe7e46cb4 100644 --- a/docs/zh-CN/components/property.md +++ b/docs/zh-CN/components/property.md @@ -196,7 +196,7 @@ order: 60 }, "body": { "type": "property", - "source": "items" + "source": "${items}" } } ``` diff --git a/src/renderers/Property.tsx b/src/renderers/Property.tsx index 8bd6e7326..de87c0b60 100644 --- a/src/renderers/Property.tsx +++ b/src/renderers/Property.tsx @@ -120,9 +120,10 @@ export default class Property extends React.Component { prepareRows() { const {column = 3, items, source, data} = this.props; - const propertyItems = items - ? items - : (resolveVariable(source, data) as Array); + const propertyItems = + (items + ? items + : (resolveVariable(source, data) as Array)) || []; const rows: PropertyContent[][] = [];