mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-17 14:56:48 +08:00
接口初始化 第一版
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
const routes = [];
|
||||
const context =import.meta.glob("../views/*/*.vue")
|
||||
const context =import.meta.glob("../views/*/*.vue", {eager: true})
|
||||
Object.keys(context).forEach(path => {
|
||||
const componentName = path.replace(/.*\/([^\\.\\/]*)\.vue$/, '$1');
|
||||
routes.push({
|
||||
path: `/${componentName.toLowerCase()}`,
|
||||
name: componentName,
|
||||
component: () => import(path/* @vite-ignore */),
|
||||
component: context[path].default,
|
||||
meta: {
|
||||
isLink: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user