Skip to content

Commit ce3afd4

Browse files
committed
feat: process empty logic
1 parent 8f626e4 commit ce3afd4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/common/className.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { isEmpty } from 'loadsh';
12
import { APP_PREFIX } from 'mo/common/const';
23
/**
34
* This function help you prefix a css class name, default is molecule.
@@ -11,6 +12,7 @@ export function prefixClaName(name: string, prefix: string = APP_PREFIX) {
1112
}
1213

1314
export function classNames(...args) {
15+
if (isEmpty(args)) return
1416
let classList: string[] = [];
1517
for (let arg of args) {
1618
if (!arg) continue;

src/components/tabs/tabButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function TabButton({
4444
<div
4545
className={classNames(
4646
'tab-button',
47-
{ 'tab-button--active': true },
47+
{ 'tab-button--active': active },
4848
className
4949
)}
5050
onClick={handleClick}

0 commit comments

Comments
 (0)