feat(类型定义): 添加标签页相关类型定义
- 新增 TabItem 接口定义标签页数据结构 - 新增 TabsState 接口定义标签页状态 - 新增 ContextMenuType 枚举定义右键菜单操作类型 - 支持标签页的增删改查功能
This commit is contained in:
parent
dade1709f8
commit
3501ac55c9
43
src/types/tabs.ts
Normal file
43
src/types/tabs.ts
Normal 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',
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user