Add support for nested dyanmic components (#6227)

This commit is contained in:
Neil MacDougall 2022-07-07 18:57:42 +01:00 committed by GitHub
parent 7d2ef51455
commit 8eb8baf882
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -18,3 +18,4 @@ shell/assets/fonts
assets/fonts
shell/pkg/import.js
pkg/rancher-components/
shell/rancher-components/

View File

@ -164,6 +164,16 @@ export class Plugin implements IPlugin {
}
public register(type: string, name: string, fn: Function) {
const nparts = name.split('/');
// Support components in a sub-folder - component_name/index.vue (and ignore other componnets in that folder)
if (nparts.length === 2) {
if (nparts[1] !== 'index') {
return;
}
name = nparts[0];
}
// Accumulate l10n resources rather than replace
if (type === 'l10n') {
if (!this.l10n[name]) {