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', +}