From 8c8fd18c6cefe604fc6d780eaa46cec1e91f0dc0 Mon Sep 17 00:00:00 2001 From: "Zhenfei.Li" Date: Tue, 27 Dec 2022 15:17:37 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-13947=20refactor:=20base=E7=9A=84es6?= =?UTF-8?q?=E5=8C=96demo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/1.pane.js | 22 +++++++++++----------- src/base/index.js | 9 +++++++++ src/core/index.js | 2 ++ 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 src/base/index.js diff --git a/src/base/1.pane.js b/src/base/1.pane.js index f613cbdd7..c87e33bfc 100644 --- a/src/base/1.pane.js +++ b/src/base/1.pane.js @@ -6,21 +6,23 @@ * @extends BI.Widget * @abstract */ -import { shortcut } from "../core/decorator"; +import { Widget, shortcut } from "../core"; @shortcut() -export class Pane extends BI.Widget { +export default class Pane extends Widget { static xtype = "bi.pane"; static EVENT_LOADED = "EVENT_LOADED"; static EVENT_LOADING = "EVENT_LOADING"; - props = { - _baseCls: "bi-pane", - tipText: BI.i18nText("BI-No_Selected_Item"), - loadingText: "", - loadingSize: "small", - overlap: true, - onLoaded: BI.emptyFn, + _defaultConfig() { + return BI.extend(super._defaultConfig(), { + _baseCls: "bi-pane", + tipText: BI.i18nText("BI-No_Selected_Item"), + loadingText: "", + loadingSize: "small", + overlap: true, + onLoaded: BI.emptyFn, + }); } _assertTip() { @@ -129,5 +131,3 @@ export class Pane extends BI.Widget { this.check(); } } - -BI.extend(BI, { Pane }); diff --git a/src/base/index.js b/src/base/index.js new file mode 100644 index 000000000..c10043847 --- /dev/null +++ b/src/base/index.js @@ -0,0 +1,9 @@ +import Pane from "./1.pane"; + +BI.extend(BI, { + Pane, +}); + +export { + Pane, +} \ No newline at end of file diff --git a/src/core/index.js b/src/core/index.js index d168cc0bc..8c345df4c 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -1,3 +1,4 @@ +import { shortcut } from "./decorator"; import OB from "./3.ob"; import Widget from "./4.widget"; import Action from "./action/action"; @@ -35,6 +36,7 @@ BI.extend(BI, { }); export { + shortcut, OB, Widget, Action,