diff --git a/src/core/shortcut.js b/src/core/shortcut.js index 9ab6d3768..a287091cb 100644 --- a/src/core/shortcut.js +++ b/src/core/shortcut.js @@ -4,6 +4,9 @@ if (kv[xtype] != null) { _global.console && console.error("shortcut:[" + xtype + "] has been registed"); } + if (cls) { + cls["xtype"] = xtype; + } kv[xtype] = cls; }; diff --git a/typescript/index.ts b/typescript/index.ts index ed9f79215..903d9c6e3 100644 --- a/typescript/index.ts +++ b/typescript/index.ts @@ -48,6 +48,7 @@ type ClassConstructor = T & { new(config: any): T; (config: any): T; readonly prototype: T; + readonly xtype: string; } export interface BI extends _func, _i18n, _base, _inject {