feat: add info

This commit is contained in:
zhuzhengjian
2025-09-02 10:50:48 +08:00
commit 8053fdfc37
33 changed files with 5176 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
import type { App } from 'vue'
import type { Router, RouteRecordRaw } from 'vue-router'
export interface PageType {
component: any
meta?: RouteRecordRaw['meta']
name?: string
}
export interface ModuleOptions {
/**
* 初始化模块配置
* @param app
*/
app?: (app: App) => Promise<void> | void
/**
* 静态的路由配置信息
*/
routes?: RouteRecordRaw[] | ((routes: RouteRecordRaw[]) => RouteRecordRaw[])
/**
* 动态路由页面配置
*/
pages?: Record<string, PageType>
/**
* 给用户router的实例进行操作
*/
router?: (router: Router) => Promise<void> | void
/**
* 这里的setup就是rootComponent的setup
*/
setup?: () => void
}
export function defineModule(options: ModuleOptions) {
return options
}