diff --git a/components/Tabs.js b/components/Tabs.js
index 6f08aada..eb1e2e69 100644
--- a/components/Tabs.js
+++ b/components/Tabs.js
@@ -1,4 +1,4 @@
-import React, { useState } from 'react'
+import { useState } from 'react';
/**
* Tabs切换标签
@@ -6,59 +6,37 @@ import React, { useState } from 'react'
* @returns
*/
const Tabs = ({ className, children }) => {
- const [currentTab, setCurrentTab] = useState(0)
+ const [currentTab, setCurrentTab] = useState(0);
- if (!children) {
- return <>>
+ const validChildren = children.filter(c => c);
+
+ if (validChildren.length === 0) {
+ return <>>;
}
- children = children.filter(c => c && c !== '')
-
- let count = 0
- children.forEach(e => {
- if (e) {
- count++
- }
- })
-
- if (count === 0) {
- return <>>
- }
-
- if (count === 1) {
- return