From f7c9c9a3417a17d1b5a97b9c4376f5b6a8baeebb Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 8 Mar 2022 14:27:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feature=EF=BC=9A=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index 2d5c3d8da..f01b0bfa7 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -570,12 +570,12 @@ throw new Error("组件:组件名已存在,不能进行添加"); } widget._setParent && widget._setParent(this); - // if(!this.isEnabled()){ - // widget._setEnable(false); - // } - // if(!this.isValid()){ - // widget._setValid(false); - // } + if (!this.options.disabled) { + widget.options && (widget.options.disabled = false); + } + if (!this.options.invalid) { + widget.options && (widget.options.invalid = false); + } widget.on(BI.Events.DESTROY, function () { BI.remove(self._children, this); }); From f02a4d2e702bf7bbb3f52dc4dadd3d60a09d39ec Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 10 Mar 2022 10:29:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feature=EF=BC=9A=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/4.widget.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/4.widget.js b/src/core/4.widget.js index f01b0bfa7..bddc7caba 100644 --- a/src/core/4.widget.js +++ b/src/core/4.widget.js @@ -570,11 +570,11 @@ throw new Error("组件:组件名已存在,不能进行添加"); } widget._setParent && widget._setParent(this); - if (!this.options.disabled) { - widget.options && (widget.options.disabled = false); + if (this.options.disabled) { + widget.options && (widget.options.disabled = true); } - if (!this.options.invalid) { - widget.options && (widget.options.invalid = false); + if (this.options.invalid) { + widget.options && (widget.options.invalid = true); } widget.on(BI.Events.DESTROY, function () { BI.remove(self._children, this);