liteng 3fb9ac6005 Revert "彻底分离出UI。"
This reverts commit 058ec5beac334a60313c681747aaa026d808ed75.
2018-11-18 10:13:30 +08:00

26 lines
684 B
JavaScript

import Button from './Button';
/**
* 图标按钮
* @author tengge / https://github.com/tengge1
* @param {*} options
*/
function IconButton(options) {
Button.call(this, options);
this.cls = options.cls || 'Button IconButton';
this.icon = options.icon || null; // 对应assets/css/icon/iconfont.css中的css
this.title = options.title || null;
}
IconButton.prototype = Object.create(Button.prototype);
IconButton.prototype.constructor = IconButton;
IconButton.prototype.render = function () {
Button.prototype.render.call(this);
if (this.icon) {
this.dom.innerHTML = `<i class="iconfont ${this.icon}"></i>`;
}
};
export default IconButton;