chore: output console error for invalid route component (#5593)
This commit is contained in:
parent
12ffb310bf
commit
7041c6a106
@ -56,12 +56,14 @@ function convertRoutes(
|
|||||||
// 页面组件转换
|
// 页面组件转换
|
||||||
} else if (component) {
|
} else if (component) {
|
||||||
const normalizePath = normalizeViewPath(component);
|
const normalizePath = normalizeViewPath(component);
|
||||||
route.component =
|
const pageKey = normalizePath.endsWith('.vue')
|
||||||
pageMap[
|
? normalizePath
|
||||||
normalizePath.endsWith('.vue')
|
: `${normalizePath}.vue`;
|
||||||
? normalizePath
|
if (pageMap[pageKey]) {
|
||||||
: `${normalizePath}.vue`
|
route.component = pageMap[pageKey];
|
||||||
];
|
} else {
|
||||||
|
console.error(`route component is invalid: ${pageKey}`, route);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return route;
|
return route;
|
||||||
|
Loading…
Reference in New Issue
Block a user