From 552a6732b94951980266cf235606e30586a47694 Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2betop.cn@gmail.com> Date: Thu, 16 Nov 2023 17:09:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20each=20#8452=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9A=84=E5=8F=96=E6=95=B0=E6=8D=AE=E5=8F=98?= =?UTF-8?q?=E5=8C=96=20breakchange=20Close:=20#8616=20(#8768)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Each.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/amis/src/renderers/Each.tsx b/packages/amis/src/renderers/Each.tsx index f66f0792f..900891a28 100644 --- a/packages/amis/src/renderers/Each.tsx +++ b/packages/amis/src/renderers/Each.tsx @@ -27,8 +27,7 @@ function EachItem(props: EachExtraProps) { const ctx = React.useMemo( () => createObject(data, { - ...(isObject(item) ? item : {}), - [name]: item, + ...(isObject(item) ? {index, ...item} : {[name]: item}), [itemKeyName || 'item']: item, [indexKeyName || 'index']: index }),