From 0abcd25b2ae9a0dc4db57b760817c8a3a64a6e79 Mon Sep 17 00:00:00 2001 From: cc heart <71313168+cc-hearts@users.noreply.github.com> Date: Mon, 23 Oct 2023 10:12:26 +0800 Subject: [PATCH] fix: fix space duplicated key (#7048) --- 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 c61b12ca8..4942461f7 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') {