mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
17 lines
423 B
JavaScript
17 lines
423 B
JavaScript
const routes = [];
|
|
const context = require.context("@/views", true, /\.vue$/, "lazy");
|
|
context.keys().forEach((path) => {
|
|
// console.log('path', path)
|
|
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, "$1");
|
|
routes.push({
|
|
path: `/${componentName.toLowerCase()}/:id?`,
|
|
name: componentName,
|
|
component: () => context(path),
|
|
meta: {
|
|
isLink: true,
|
|
},
|
|
});
|
|
});
|
|
|
|
export default routes;
|