Skip to content

Commit 60f7bec

Browse files
committed
1 parent ca7af4d commit 60f7bec

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

adminforth/modules/codeInjector.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ class CodeInjector implements ICodeInjector {
531531
}
532532
}
533533

534+
if (this.adminforth.config.componentsToExplicitRegister) {
535+
this.adminforth.config.componentsToExplicitRegister.forEach((component) => {
536+
if (!customResourceComponents.includes(component)) {
537+
customResourceComponents.push(component.file);
538+
}
539+
});
540+
}
541+
534542
customResourceComponents.forEach((filePath) => {
535543
const componentName = getComponentNameFromPath(filePath);
536544
this.allComponentNames[filePath] = componentName;

adminforth/types/Back.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,24 @@ export interface AdminForthInputConfig {
15831583
*
15841584
*/
15851585
baseUrl?: string,
1586+
1587+
1588+
/**
1589+
* Most of components are explicitely registered in AdminForth e.g. when you are using them in renderers, page injections and so on.
1590+
* But some times you might want to have some components registered globally Explicitly. E.g. for ussage in other components without import.
1591+
*
1592+
* ```ts
1593+
* componentsToExplicitRegister: [
1594+
* {
1595+
* file: '@@/my-component.vue',
1596+
* meta: {
1597+
* some: 'meta'
1598+
* }
1599+
* }
1600+
* ```
1601+
*
1602+
*/
1603+
componentsToExplicitRegister?: AdminForthComponentDeclarationFull[]
15861604

15871605
}
15881606

0 commit comments

Comments
 (0)