We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tabs
2.55.2
No response
当前版本使用官网上Tabs示例就能复现
- OS: - browser:
The text was updated successfully, but these errors were encountered:
复现demo
export const Test111 = () => { const [num, setNum] = useState(6); const [tabList, setTabList] = useState([ { tab: '文档', itemKey: '1', text: '文档', closable: true }, { tab: '快速起步', itemKey: '2', text: '快速起步', closable: true }, { tab: '帮助', itemKey: '3', text: '帮助',closable: true }, { tab: '文档1', itemKey: '4', text: '文档4', closable: true }, ]); const close = useCallback((key) => [ setTabList((tabList => { return tabList.filter(t=>t.itemKey!==key) })) ], []); const add = useCallback(() => { setNum((num) => num+1); setTabList((tabList => { return [...tabList, { tab: `文档${num +1}`, itemKey: `${num +1}`, text: `文档${num +1}`, closable: true, } ] })) }, [num]) return ( <> <Button onClick={add}>新增</Button> <Tabs type="card" defaultActiveKey="1" onTabClose={close} collapsible style={{ width: 400 }}> { tabList.map(t=><TabPane closable={t.closable} tab={t.tab} itemKey={t.itemKey} key={t.itemKey}>{t.text}</TabPane>) } </Tabs> </> ); }
Sorry, something went wrong.
@YannLynn 有空 cc
YannLynn
No branches or pull requests
Is there an existing issue for this?
Which Component
Tabs
Semi Version
2.55.2
Current Behavior
No response
Expected Behavior
No response
Steps To Reproduce
当前版本使用官网上Tabs示例就能复现
ReproducibleCode
No response
Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: