Browse Source

chore: bugfix

es6
guy 3 years ago
parent
commit
007665dd83
  1. 22
      src/core/4.widget.js

22
src/core/4.widget.js

@ -398,10 +398,16 @@
lifeHook !== false && !this.__async && callLifeHook(this, "beforeMount"); lifeHook !== false && !this.__async && callLifeHook(this, "beforeMount");
this._isMounted = true; this._isMounted = true;
this.__isMounting = false; this.__isMounting = false;
if (this._parent) {
if (!this._parent.isEnabled()) {
this._setEnable(false);
}
if (!this._parent.isValid()) {
this._setValid(false);
}
}
for (var key in this._children) { for (var key in this._children) {
var child = this._children[key]; var child = this._children[key];
!self.isEnabled() && child._setEnable(false);
!self.isValid() && child._setValid(false);
child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1); child._mount && child._mount(deep ? force : false, deep, lifeHook, predicate, layer + 1);
} }
this._mountChildren && this._mountChildren(); this._mountChildren && this._mountChildren();
@ -591,12 +597,12 @@
throw new Error("组件:组件名已存在,不能进行添加"); throw new Error("组件:组件名已存在,不能进行添加");
} }
widget._setParent && widget._setParent(this); widget._setParent && widget._setParent(this);
if (this.options.disabled) { // if (this.options.disabled) {
widget.options && (widget.options.disabled = true); // widget.options && (widget.options.disabled = true);
} // }
if (this.options.invalid) { // if (this.options.invalid) {
widget.options && (widget.options.invalid = true); // widget.options && (widget.options.invalid = true);
} // }
widget.on(BI.Events.DESTROY, function () { widget.on(BI.Events.DESTROY, function () {
BI.remove(self._children, this); BI.remove(self._children, this);
}); });

Loading…
Cancel
Save