From 4806709c1c4ba096d3f2df97e630b728759061cf Mon Sep 17 00:00:00 2001 From: allenve Date: Mon, 21 Oct 2024 11:23:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20tabs=20activeKey=20=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Tabs.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/amis/src/renderers/Tabs.tsx b/packages/amis/src/renderers/Tabs.tsx index ab565f939..607eb6673 100644 --- a/packages/amis/src/renderers/Tabs.tsx +++ b/packages/amis/src/renderers/Tabs.tsx @@ -271,10 +271,10 @@ export default class Tabs extends React.Component { ? resolveVariableAndFilter(props.defaultKey, props.data) : props.defaultKey; } else if (props.defaultActiveKey) { - activeKey = resolveVariableAndFilter( - props.defaultActiveKey, - props.data - ); + activeKey = + typeof props.defaultActiveKey === 'string' + ? resolveVariableAndFilter(props.defaultActiveKey, props.data) + : props.defaultActiveKey; } activeKey = activeKey || (tabs[0] && tabs[0].hash) || 0;