From 3501ac55c9be609ec296bcd97f381d7f1e70715b Mon Sep 17 00:00:00 2001 From: gaoziman <2942894660@qq.com> Date: Fri, 7 Nov 2025 22:35:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E9=A1=B5=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 TabItem 接口定义标签页数据结构 - 新增 TabsState 接口定义标签页状态 - 新增 ContextMenuType 枚举定义右键菜单操作类型 - 支持标签页的增删改查功能 --- src/types/tabs.ts | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/types/tabs.ts diff --git a/src/types/tabs.ts b/src/types/tabs.ts new file mode 100644 index 0000000..80bb5b0 --- /dev/null +++ b/src/types/tabs.ts @@ -0,0 +1,43 @@ +/** + * 标签页相关类型定义 + */ + +/** + * 标签页项数据结构 + */ +export interface TabItem { + /** 标签唯一标识 */ + key: string; + /** 标签显示名称 */ + name: string; + /** 路由路径 */ + path: string; + /** 是否可关闭 */ + closable: boolean; +} + +/** + * 标签页状态 + */ +export interface TabsState { + /** 当前激活的标签 key */ + activeKey: string; + /** 标签列表 */ + tabs: TabItem[]; +} + +/** + * 右键菜单操作类型 + */ +export enum ContextMenuType { + /** 重新加载 */ + RELOAD = 'reload', + /** 关闭当前 */ + CLOSE_CURRENT = 'closeCurrent', + /** 关闭左侧 */ + CLOSE_LEFT = 'closeLeft', + /** 关闭右侧 */ + CLOSE_RIGHT = 'closeRight', + /** 关闭其他 */ + CLOSE_OTHERS = 'closeOthers', +}