feat: 网络层优化

This commit is contained in:
ZhuRui
2026-07-31 18:15:24 +08:00
parent 3b107e8d52
commit 3e94ce60ec
41 changed files with 900 additions and 87 deletions
+21 -16
View File
@@ -147,22 +147,27 @@ const PageTabs = defineComponent({
const activeIndex = props.tabs.findIndex((tab) => tab.path === props.activeKey);
if (activeIndex === -1) return;
if (key === 'left') {
if (activeIndex === 0) {
message.warning('左侧没有可关闭的标签页');
return;
}
props.onCloseLeft?.(props.activeKey);
} else if (key === 'right') {
if (activeIndex === props.tabs.length - 1) {
message.warning('右侧没有可关闭的标签页');
return;
}
props.onCloseRight?.(props.activeKey);
} else if (key === 'other') {
props.onCloseOther?.(props.activeKey);
} else if (key === 'all') {
props.onCloseAll?.();
switch (key) {
case 'left':
if (activeIndex === 0) {
message.warning('左侧没有可关闭的标签页');
return;
}
props.onCloseLeft?.(props.activeKey);
break;
case 'right':
if (activeIndex === props.tabs.length - 1) {
message.warning('右侧没有可关闭的标签页');
return;
}
props.onCloseRight?.(props.activeKey);
break;
case 'other':
props.onCloseOther?.(props.activeKey);
break;
case 'all':
props.onCloseAll?.();
break;
}
};