Browse Source

KERNEL-14035 refactor: 挂载Element

es6
Zhenfei.Li 2 years ago
parent
commit
8fcb09c1e3
  1. 5
      src/core/element/index.js
  2. 5
      src/core/index.js

5
src/core/element/index.js

@ -1,8 +1,7 @@
import { Element } from "./element"; import { Element } from "./element";
import { isString, isWidget } from "../2.base"; import { isString, isWidget } from "../2.base";
BI.Element = Element; Element.renderEngine = {
BI.Element.renderEngine = {
createElement: widget => { createElement: widget => {
if (isWidget(widget)) { if (isWidget(widget)) {
const o = widget.options; const o = widget.options;
@ -30,3 +29,5 @@ BI.Element.renderEngine = {
return new Element(); return new Element();
}, },
}; };
export { Element };

5
src/core/index.js

@ -14,6 +14,7 @@ import { ShowListener } from "./listener/listener.show";
import { useInWorker } from "./worker"; import { useInWorker } from "./worker";
import * as constant from "./constant"; import * as constant from "./constant";
import * as logic from "./logic"; import * as logic from "./logic";
import { Element } from "./element";
export * from "./decorator"; export * from "./decorator";
export * from "./2.base"; export * from "./2.base";
@ -33,7 +34,8 @@ export {
StyleLoaderManager, StyleLoaderManager,
ShowListener, ShowListener,
Plugin, Plugin,
useInWorker useInWorker,
Element
}; };
Object.assign(BI, { Object.assign(BI, {
@ -47,6 +49,7 @@ Object.assign(BI, {
component: inject.shortcut, component: inject.shortcut,
...action, ...action,
...controllers, ...controllers,
Element,
...func, ...func,
StyleLoaderManager, StyleLoaderManager,
ShowListener, ShowListener,

Loading…
Cancel
Save