Tabs组件优化

This commit is contained in:
tangly1024
2022-03-02 13:11:24 +08:00
parent df0977240f
commit ed69b9a885

View File

@@ -43,9 +43,8 @@ const Tabs = ({ className, children }) => {
</ul>
<div>
{children.map((item, index) => {
return <section key={index}
className={`${currentTab === index ? 'block animate__animated animate__fadeIn animate__faster' : 'hidden'}`}>
{item}
return <section key={index} className={ 'animate__animated animate__fadeIn animate__faster'}>
{currentTab === index && item}
</section>
})}
</div>