fix: 处理报错

This commit is contained in:
ZhuRui
2026-07-27 17:08:21 +08:00
parent b6e91bfbac
commit cc5ca261c6
4 changed files with 18 additions and 19 deletions
+3 -3
View File
@@ -38,7 +38,7 @@
}
// ── hover 态(非激活) ──
&:not(.active) {
&:not(.tabItemActive) {
&:hover {
// 自身分隔线消失
> .divider {
@@ -54,7 +54,7 @@
}
// ── 激活态 ──
&.active {
&.tabItemActive {
z-index: 2;
// 右侧邻居的分隔线消失
& + .tabItem {
@@ -164,7 +164,7 @@
}
// hover 只在非激活标签时生效
.tabItem:not(.active) {
.tabItem:not(.tabItemActive) {
.tabTitleCon:hover {
background-color: rgba(0, 0, 0, 0.06);
}
+6 -4
View File
@@ -1,6 +1,6 @@
import { defineComponent, type PropType } from 'vue';
import { message } from 'ant-design-vue';
import type { TabView } from '@/stores/tabsStore';
import type { TabView } from '@/types';
import styles from './PageTabs.module.less';
/**
@@ -12,7 +12,7 @@ import styles from './PageTabs.module.less';
* - 标签间分隔线
* - 关闭按钮
*/
export default defineComponent({
const PageTabs = defineComponent({
name: 'PageTabs',
props: {
/** 标签列表 */
@@ -49,7 +49,7 @@ export default defineComponent({
return (
<div
key={tab.path}
class={[styles.tabItem, isActive ? styles.active : '', styles.draggable].join(' ')}
class={[styles.tabItem, isActive && styles.tabItemActive].filter(Boolean).join(' ')}
onClick={() => handleClick(tab.path)}
>
{/* 分隔线:第一个标签 / 激活标签 / 上一个就是激活的 → 不显示 */}
@@ -59,7 +59,7 @@ export default defineComponent({
/>
{/* Chrome 风格背景:激活态 */}
<div class={[styles.tabBg, isActive ? styles.tabBgActive : ''].join(' ')}>
<div class={[styles.tabBg, isActive && styles.tabBgActive].filter(Boolean).join(' ')}>
<div class={styles.tabBgInner} />
{/* 左下曲线 */}
<svg class={styles.tabBgCurveBefore} height="7" width="7">
@@ -87,3 +87,5 @@ export default defineComponent({
);
},
});
export default PageTabs;