feat(类型定义): 添加标签页相关类型定义

- 新增 TabItem 接口定义标签页数据结构
- 新增 TabsState 接口定义标签页状态
- 新增 ContextMenuType 枚举定义右键菜单操作类型
- 支持标签页的增删改查功能
This commit is contained in:
gaoziman 2025-11-07 22:35:20 +08:00
parent dade1709f8
commit 3501ac55c9

43
src/types/tabs.ts Normal file
View File

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