Browse Source

新增h函数

es6
guy 3 years ago
parent
commit
fcb76d33b4
  1. 19
      src/core/h.js

19
src/core/h.js

@ -0,0 +1,19 @@
BI.Fragment = function () {
};
BI.h = function (type, props, children) {
if (type === BI.Fragment) {
return children;
}
if (BI.isFunction(type)) {
type = type.xtype;
}
if (type === "el") {
return BI.extend({
el: children[0]
}, props);
}
return BI.extend({
items: children
}, props);
};
Loading…
Cancel
Save