Browse Source

Pull request #2365: 无JIRA任务 chore: 优化下写法,react中children是关键字

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '057b729187a428157f9cedfd7ae0cd11858c3c5a':
  chore: 优化下写法,react中children是关键字
es6
guy 3 years ago
parent
commit
89fa6fa7e8
  1. 6
      src/base/combination/group.combo.js
  2. 3
      src/widget/downlist/popup.downlist.js
  3. 1
      src/widget/multilayerdownlist/popup.downlist.js

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

@ -16,7 +16,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
isNeedAdjustWidth: false,
el: {type: "bi.text_button", text: "", value: ""},
children: [],
items: [],
popup: {
el: {
@ -36,7 +36,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
_populate: function (item) {
var self = this, o = this.options;
var children = o.children;
var children = o.items;
if (BI.isEmpty(children)) {
throw new Error("ComboGroup构造错误");
}
@ -45,7 +45,7 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
ch = BI.formatEL(ch).el;
if (!BI.isEmpty(son)) {
ch.el = BI.clone(ch);
ch.children = son;
ch.items = son;
ch.type = "bi.combo_group";
ch.action = o.action;
ch.height = o.height;

3
src/widget/downlist/popup.downlist.js

@ -114,6 +114,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
maxHeight: 378
};
item.el.childValues = [];
item.items = item.children;
BI.each(item.children, function (i, child) {
var fatherValue = BI.deepClone(item.el.value);
var childValue = BI.deepClone(child.value);
@ -284,4 +285,4 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
BI.DownListPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.DownListPopup.EVENT_SON_VALUE_CHANGE = "EVENT_SON_VALUE_CHANGE";
BI.shortcut("bi.down_list_popup", BI.DownListPopup);
BI.shortcut("bi.down_list_popup", BI.DownListPopup);

1
src/widget/multilayerdownlist/popup.downlist.js

@ -155,6 +155,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
_createChildren: function (item) {
var self = this;
this._formatEL(item).el.childValues = [];
item.items = item.children;
BI.each(item.children, function (i, child) {
child = child.el ? BI.extend(child.el, {children: child.children}) : child;
var fatherValue = BI.deepClone(self._formatEL(item).el.value);

Loading…
Cancel
Save