Files
myprojplanet_vite/src/router/route-config.ts

46 lines
1.0 KiB
TypeScript
Raw Normal View History

2021-08-31 18:09:59 +02:00
import { static_data } from '@src/db/static_data'
import type { RouteRecordRaw } from 'vue-router'
2025-03-01 14:14:43 +01:00
import { tools } from '@tools'
import { useGlobalStore } from '@store/globalStore'
2021-08-31 18:09:59 +02:00
interface IMyMeta {
title?: string,
headerShadow?: boolean,
contentProp?: boolean,
transparent?: boolean,
isModal?: boolean,
requiresAuth?: boolean,
isTab?: boolean,
noAuth?: boolean,
// asyncData?: (to?: IMyRoute | IMyRouteRecord) => Promise<{title?: string} | void>,
asyncData?: (to?: any) => Promise<{ title?: string } | void>,
isAuthorized?: (to?: any) => boolean
middleware?: any[]
}
/*
export interface IMyRoute extends Route {
meta: IMyMeta,
matched: IMyRouteRecord[]
}
export interface IMyRouteRecord extends RouteRecord {
meta: IMyMeta,
}
*/
export const cfgrouter = {
getmenu(): RouteRecordRaw[] {
const arrroutes: RouteRecordRaw[] = []
for (const route of static_data.routes) {
tools.addRoute(arrroutes, route)
}
2024-01-02 15:24:57 +01:00
// console.log('getmenu', arrroutes)
2021-09-16 21:08:02 +02:00
2021-08-31 18:09:59 +02:00
return arrroutes
},
}