--- order: 99 debug: true title: zh-CN: 嵌套 en-US: Nest --- ## zh-CN 默认选中第一项。 ## en-US Default activate first tab. ```tsx import { Select, Tabs } from 'antd'; import React, { useState } from 'react'; const { Option } = Select; const positionList = ['left', 'right', 'top', 'bottom']; const App: React.FC = () => { const [parentPos, setParentPos] = useState(undefined); const [childPos, setChildPos] = useState(undefined); const [parentType, setParentType] = useState(undefined); const [childType, setChildType] = useState(undefined); return (
{ const key = String(index); return { label: `Tab ${key}`, key, children: `TTTT ${key}`, }; })} /> ), }, { label: 'Tab 2', key: '2', children: 'Content of Tab Pane 2', }, ]} />
); }; export default App; ```