export const registAttrFun = (Element) => { Element.registerFunction('attr', function (key, value) { var self = this; if (BI.isObject(key)) { BI.each(key, (k, v) => { self.attr(k, v); }); return this; } if (BI.isNull(value)) { return this.attribs[key]; } this.attribs[key] = value; return this; }); Element.registerFunction('hasAttrib', function (key) { return this.attribs[key] != null; }); Element.registerFunction('removeAttr', function (key) { delete this.attribs[key]; }); };