Browse Source

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

es6
Oliver.Ke 3 years ago
parent
commit
bd2267626f
  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);
}) : o.items;
this.populate(items);
if (BI.isFunction(o.value)) {
this.__watch(o.value, function (context, newValue) {
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
})
}
}) : o.value;
if (BI.isKey(o.value) || BI.isNotEmptyArray(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);
}) : o.items;
this.populate(items);
if (BI.isFunction(o.value)) {
this.__watch(o.value, function (context, newValue) {
o.value = BI.isFunction(o.value) ? this.__watch(o.value, function (context, newValue) {
self.setValue(newValue);
})
}
}) : o.value;
if (BI.isKey(o.value)) {
this.setValue(o.value);
}

Loading…
Cancel
Save