import type { RouteMeta, RouteLocationMatched } from 'vue-router'; /** * vue class 类型 */ export type ClassType = Array | undefined>; /** * 菜单 meta 数据类型 */ export interface MenuMeta extends RouteMeta { title?: string; icon?: string; color?: string; hide?: boolean; active?: string; hideFooter?: boolean; hideSidebar?: boolean; closable?: boolean; tabUnique?: boolean; breadcrumb?: boolean; keepAlive?: boolean; fullPath?: string; name?: string; routePath?: string; parentPath?: string; iframe?: string; group?: boolean; badge?: string | number; badgeColor?: string; } /** * 菜单数据类型 */ export interface MenuItemType { path: string; name?: string; meta: MenuMeta; component?: string; redirect?: string; children?: Array; tempChildren?: Array; } /** * 菜单数据类型 */ export type MenuItem = MenuItemType; /** * 页签数据类型 */ export interface TabItem { key?: string; title?: string; path?: string; fullPath?: string; closable?: boolean; components?: string[]; meta?: MenuMeta; } /** * 面包屑导航数据类型 */ export interface LevelItem { title: string; path: string; fullPath: string; home?: boolean; } /** * 主题列表数据类型 */ export interface ThemeItem { name: string; value?: string; color?: string; } /** * 菜单标题国际化方法类型 */ export type MenuI18nType = (path: string, key?: string, menu?: MenuItemType, locale?: string) => string | undefined | null; /** * tab 移除事件参数类型 */ export interface TabRemoveOption { /** * 页签 key */ key: string; /** * 当前选中的页签 key */ active?: string; } /** * 当前路由数据类型 */ export interface CurrentRouteType { path: string; fullPath: string; meta: MenuMeta; matched: RouteLocationMatched[]; } /** * 顶栏风格类型 */ export type HeadStyleType = 'light' | 'dark' | 'primary'; /** * 侧栏风格类型 */ export type SideStyleType = 'light' | 'dark'; /** * 布局风格类型 */ export type LayoutStyleType = 'side' | 'top' | 'mix'; /** * 侧栏菜单风格类型 */ export type SideMenuStyleType = 'default' | 'mix'; /** * 页签风格类型 */ export type TabStyleType = 'default' | 'dot' | 'card'; /** * 页签右键菜单点击参数类型 */ export interface TabCtxMenuOption { key: string; tabKey: string; item?: TabItem; active?: string; } /** * 菜单标题国际化方法参数 */ export interface RouteI18nOption { path?: string; locale?: string; i18n?: MenuI18nType; menu?: MenuItemType; menus: MenuItemType[]; } /** * 菜单标题国际化方法类型 */ export type RouteI18nType = (path: string, menu?: MenuItemType) => string | null | undefined; /** * 窗口事件监听方法参数 */ export interface WindowListenerOption { onResize: () => void; onEscKeydown: (e: KeyboardEvent) => void; } /** * 布局状态共享数据 */ export interface LayoutProvide { isMobile?: boolean; collapse?: boolean; sideNavCollapse?: boolean; isTopMenu?: boolean; isMixSideMenu?: boolean; bodyFullscreen?: boolean; contentFullscreen?: boolean; showTabs?: boolean; haveSideMenuData?: boolean; styleResponsive?: boolean; } /** * 页签栏组件国际化语言类型 */ export interface TabsLocale { reload: string; fullscreen: string; fullscreenExit: string; closeLeft: string; closeRight: string; closeOther: string; closeAll: string; close: string; } /** * useResponsive 参数 */ export interface UseResponsiveProps extends Record { responsive?: boolean; }