Files
penna-app/packages/vue/src/modules.ts
zhuzhengjian 8053fdfc37 feat: add info
2025-09-02 10:50:48 +08:00

37 lines
783 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}