Commit 7041c6a1 by Netfan Committed by GitHub

chore: output console error for invalid route component (#5593)

1 parent 12ffb310
...@@ -56,12 +56,14 @@ function convertRoutes( ...@@ -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.endsWith('.vue')
? normalizePath ? normalizePath
: `${normalizePath}.vue` : `${normalizePath}.vue`;
]; if (pageMap[pageKey]) {
route.component = pageMap[pageKey];
} else {
console.error(`route component is invalid: ${pageKey}`, route);
}
} }
return route; return route;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!