diff --git a/demo/js/base/button/demo.button.js b/demo/js/base/button/demo.button.js index c69e01167..1f2eeec0a 100644 --- a/demo/js/base/button/demo.button.js +++ b/demo/js/base/button/demo.button.js @@ -12,9 +12,9 @@ Demo.Button = BI.inherit(BI.Widget, { height: 30, handler() { console.log("触发点击事件"); - this.setLoading(); + this.loading(); setTimeout(() => { - this.setLoaded(); + this.loaded(); }, 5 * 1000); } }, { @@ -305,9 +305,9 @@ Demo.Button = BI.inherit(BI.Widget, { text: "带加载的按钮", handler() { console.log("触发点击事件"); - this.setLoading(); + this.loading(); setTimeout(() => { - this.setLoaded(); + this.loaded(); }, 5 * 1000); } }, { @@ -316,9 +316,9 @@ Demo.Button = BI.inherit(BI.Widget, { iconCls: "circle-close-font", handler() { console.log("触发点击事件"); - this.setLoading(); + this.loading(); setTimeout(() => { - this.setLoaded(); + this.loaded(); }, 5 * 1000); } }, { @@ -328,9 +328,9 @@ Demo.Button = BI.inherit(BI.Widget, { iconCls: "circle-close-font", handler() { console.log("触发点击事件"); - this.setLoading(); + this.loading(); setTimeout(() => { - this.setLoaded(); + this.loaded(); }, 5 * 1000); } }, { diff --git a/src/base/single/button/buttons/button.js b/src/base/single/button/buttons/button.js index 778ecfe74..8f46112ca 100644 --- a/src/base/single/button/buttons/button.js +++ b/src/base/single/button/buttons/button.js @@ -183,7 +183,7 @@ return this._loading === undefined ? this.options.loading : this._loading; }, - setLoading: function (loading) { + loading: function (loading) { this._loading = true; this.element.addClass("loading"); // loadingCls 可以覆盖 iconCls 所以不需要移除 iconCls @@ -191,7 +191,7 @@ this.icon.setVisible(true); }, - setLoaded() { + loaded() { this._loading = false; this.element.removeClass("loading"); this.icon.element.removeClass(loadingCls);