mirror of https://github.com/rancher/dashboard.git
Add support for nested dyanmic components (#6227)
This commit is contained in:
parent
7d2ef51455
commit
8eb8baf882
|
|
@ -18,3 +18,4 @@ shell/assets/fonts
|
|||
assets/fonts
|
||||
shell/pkg/import.js
|
||||
pkg/rancher-components/
|
||||
shell/rancher-components/
|
||||
|
|
|
|||
|
|
@ -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]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue