Browse Source

新增h函数

es6
guy 3 years ago
parent
commit
402acaa135
  1. 4
      src/core/h.js

4
src/core/h.js

@ -10,11 +10,11 @@ BI.h = function (type, props, children) {
} }
if (type === "el") { if (type === "el") {
return BI.extend({ return BI.extend({
el: children[0] el: BI.isArray(children) ? children[0] : children
}, props); }, props);
} }
return BI.extend({ return BI.extend({
type: type, type: type,
items: children items: BI.isArray(children) ? children : [children]
}, props); }, props);
}; };
Loading…
Cancel
Save