mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
优化Tabs组件
This commit is contained in:
@@ -10,13 +10,19 @@ const Tabs = ({ className, children }) => {
|
||||
return <></>
|
||||
}
|
||||
|
||||
let count = children.length
|
||||
children = children.filter(c => c !== '')
|
||||
|
||||
let count = 0
|
||||
children.forEach(e => {
|
||||
if (!e) {
|
||||
count--
|
||||
if (e) {
|
||||
count++
|
||||
}
|
||||
})
|
||||
|
||||
if (count === 0) {
|
||||
return <></>
|
||||
}
|
||||
|
||||
if (count === 1) {
|
||||
return <section className={'duration-200 ' + className}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user