forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
497 B
22 lines
497 B
export const registCssFun = (Element) => { |
|
Element.registerFunction('css', function (key, value) { |
|
var self = this; |
|
if (BI.isObject(key)) { |
|
BI.each(key, (k, v) => { |
|
self.css(k, v); |
|
}); |
|
return this; |
|
} |
|
key = BI.trim(BI.camelize(key)); |
|
return css(this, key, value); |
|
}); |
|
}; |
|
|
|
const css = (elem, key, value) => { |
|
key = BI.trim(BI.camelize(key)); |
|
if (BI.isNull(value)) { |
|
return elem.styles[key]; |
|
} |
|
elem.styles[key] = value; |
|
return elem; |
|
};
|
|
|