mirror of
				https://github.com/CorentinTh/it-tools.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			530 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			530 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
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();
 | 
						|
 | 
						|
  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'),
 | 
						|
  },
 | 
						|
];
 |