支持npm 安装的@great-dream插件动态菜单

This commit is contained in:
liqiang
2025-02-02 09:04:13 +08:00
parent f299889c4a
commit 3c6afdac76

View File

@@ -199,7 +199,8 @@ export function dynamicImport(dynamicViewsModules: Record<string, Function>, com
const keys = Object.keys(dynamicViewsModules); const keys = Object.keys(dynamicViewsModules);
const matchKeys = keys.filter((key) => { const matchKeys = keys.filter((key) => {
const k = key.replace(/..\/views|../, ''); const k = key.replace(/..\/views|../, '');
const k1 = k.replace("ode_modules/@great-dream/", '') const k0 = k.replace("ode_modules/@great-dream/", '')
const k1 = k0.replace("/plugins", '')
const newComponent = component.replace("plugins/", "") const newComponent = component.replace("plugins/", "")
return k1.startsWith(`${newComponent}`) || k1.startsWith(`/${newComponent}`); return k1.startsWith(`${newComponent}`) || k1.startsWith(`/${newComponent}`);
}); });