diff --git a/.changeset/eight-poets-reply.md b/.changeset/eight-poets-reply.md new file mode 100644 index 000000000..f608a9dcf --- /dev/null +++ b/.changeset/eight-poets-reply.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +fix(tabs): 修复 activeId 为一个不存在的值或空值,下划线显示不对的问题 diff --git a/.changeset/sweet-garlics-shop.md b/.changeset/sweet-garlics-shop.md new file mode 100644 index 000000000..13f64c7df --- /dev/null +++ b/.changeset/sweet-garlics-shop.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/tabs": patch +--- + +fix: 修复 activeId 为一个不存在的值或空值,下划线显示不对的问题 diff --git a/packages/ui/tabs/src/TabList.tsx b/packages/ui/tabs/src/TabList.tsx index e867a42c8..7508770bf 100644 --- a/packages/ui/tabs/src/TabList.tsx +++ b/packages/ui/tabs/src/TabList.tsx @@ -253,7 +253,7 @@ export const TabList = forwardRef( direction={direction} /> ))} - {type === 'line' ? ( + {type === 'line' && data.some((item) => item.tabId === activeTabId) ? (