mirror of
https://gitee.com/newgateway/vtj.git
synced 2026-06-01 22:49:31 +08:00
19 lines
472 B
TypeScript
19 lines
472 B
TypeScript
/// <reference types="vite/client" />
|
|
import { computed } from 'vue';
|
|
const modules = import.meta.glob(['/dev/views/**/*.vue']);
|
|
|
|
export const routes = computed(() => {
|
|
const files = Object.keys(modules);
|
|
const items: any[] = [];
|
|
for (let key of files) {
|
|
const path = key.replace('.vue', '').replace('/dev/', '');
|
|
items.push({
|
|
path: path === 'views/index' ? '' : path,
|
|
component: modules[key]
|
|
});
|
|
}
|
|
return items;
|
|
});
|
|
|
|
export { modules };
|