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') {