Browse Source

Pull request #2624: BI-104081 fix: ButtonGroup的value属性传函数时,首次渲染不会进行setValue

Merge in VISUAL/fineui from ~OLIVER.KE/fineui:master to master

* commit 'bd2267626f52bf3deea2230d8bb2821ec98c4ae3':
  BI-104081 fix: ButtonGroup的value属性传函数时,首次渲染不会进行setValue
es6
Oliver.Ke 3 years ago
parent
commit
4a53163362
  1. 6
      src/base/combination/group.button.js
  2. 6
      src/base/combination/group.virtual.js

6
src/base/combination/group.button.js

@ -33,11 +33,9 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
this.populate(items); this.populate(items);
if (BI.isFunction(o.value)) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) }) : o.value;
}
if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) { if (BI.isKey(o.value) || BI.isNotEmptyArray(o.value)) {
this.setValue(o.value); this.setValue(o.value);
} }

6
src/base/combination/group.virtual.js

@ -17,11 +17,9 @@ BI.VirtualGroup = BI.inherit(BI.Widget, {
self.populate(newValue); self.populate(newValue);
}) : o.items; }) : o.items;
this.populate(items); this.populate(items);
if (BI.isFunction(o.value)) { o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
this.__watch(o.value, function (context, newValue) {
self.setValue(newValue); self.setValue(newValue);
}) }) : o.value;
}
if (BI.isKey(o.value)) { if (BI.isKey(o.value)) {
this.setValue(o.value); this.setValue(o.value);
} }

Loading…
Cancel
Save