Detect undefined component

This commit is contained in:
the1812 2022-01-04 09:01:42 +08:00
parent ed61eea287
commit 687d875e41

View File

@ -82,6 +82,10 @@ export const isComponentEnabled = (component: ComponentMetadata | string) => {
if (typeof component === 'string') {
component = componentsMap[component]
}
// 不存在 / 未安装的组件
if (!component) {
return false
}
// 若指定了排除URL, 任意URL匹配就不加载
if (component.urlExclude && component.urlExclude.some(matchUrlPattern)) {
return false