From 995b121402f7e40ee507f290233d0124c9ab51c7 Mon Sep 17 00:00:00 2001 From: heart <7362469@qq.com> Date: Fri, 20 Oct 2023 18:25:16 +0800 Subject: [PATCH] fix: fix space duplicated key --- components/space/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/space/index.tsx b/components/space/index.tsx index c61b12ca8d..4942461f74 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -107,7 +107,10 @@ const Space = defineComponent({ style={[style.value, attrs.style as CSSProperties]} > {items.map((child, index) => { - const originIndex = children.indexOf(child); + let originIndex = children.indexOf(child); + if (originIndex === -1) { + originIndex = `$$space-${index}`; + } let itemStyle: CSSProperties = {}; if (!supportFlexGap.value) { if (direction === 'vertical') {