Skip to content

Commit

Permalink
Merge pull request #11080 from allenve/fix-tabs-defaultActiveKey
Browse files Browse the repository at this point in the history
fix: tabs activeKey 失效
  • Loading branch information
allenve authored Oct 21, 2024
2 parents 07b8031 + 4806709 commit 9597f79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/amis/src/renderers/Tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,10 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
? 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;
Expand Down

0 comments on commit 9597f79

Please sign in to comment.