feat: 网络层优化
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user