mirror of
https://github.com/Art051/it-tools.git
synced 2025-08-11 19:29:03 +00:00
feat(ui-lib): demo pages for c-lib components
This commit is contained in:
committed by
Corentin THOMASSET
parent
e88c1d5f2c
commit
92bd83536f
25
src/ui/demo/demo.routes.ts
Normal file
25
src/ui/demo/demo.routes.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { RouteRecordRaw } from 'vue-router';
|
||||
|
||||
const demoPages = import.meta.glob('../*/*.demo.vue');
|
||||
|
||||
export const demoRoutes = Object.keys(demoPages).map((path) => {
|
||||
const [, , fileName] = path.split('/');
|
||||
const name = fileName.split('.').shift();
|
||||
|
||||
console.log(path);
|
||||
|
||||
return {
|
||||
path: name,
|
||||
name,
|
||||
component: () => import(/* @vite-ignore */ path),
|
||||
} as RouteRecordRaw;
|
||||
});
|
||||
|
||||
export const routes = [
|
||||
{
|
||||
path: '/c-lib',
|
||||
name: 'c-lib',
|
||||
children: demoRoutes,
|
||||
component: () => import('./demo-wrapper.vue'),
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user