Browse Source

Pull request #2303: bi.button,bi.text, bi.label,bi.html_label等支持直接写text

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

* commit '94e87e463c9c5cbf2d70b5d51dbed59152adcc43':
  bi.button,bi.text, bi.label,bi.html_label等支持直接写text
es6
Dailer 3 years ago
parent
commit
ebb2a121ed
  1. 8
      src/core/h.js

8
src/core/h.js

@ -39,7 +39,13 @@ BI.h = function (type, props, children) {
right: children
}, props);
}
if (children.length === 1 && BI.isKey(children[0])) {
return BI.extend({
type: type
}, children.length > 0 ? {items: children} : {}, props);
}, { text: children[0] }, props);
}
return BI.extend({
type: type
}, children.length > 0 ? { items: children } : {}, props);
};

Loading…
Cancel
Save