Browse Source

KERNEL-9408 fix:修改其它框架实现图标的方式

es6
treecat 2 years ago
parent
commit
6895777066
  1. 6
      demo/js/base/button/demo.button.js
  2. 11
      src/base/single/button/buttons/button.js

6
demo/js/base/button/demo.button.js

@ -376,6 +376,12 @@ Demo.Button = BI.inherit(BI.Widget, {
this.loaded();
}, 5 * 1000);
},
}, {
type: "bi.button",
text: "图标的实现交给其他框架",
icon(element) {
element.append("<span>🧙</span>");
},
}];
return {

11
src/base/single/button/buttons/button.js

@ -91,15 +91,16 @@
}
var iconInvisible = !o.loading && !o.iconCls;
if (BI.isObject(o.icon) && BI.isString(o.icon.type)) {
// FineUI 自定义 icon
if (BI.isPlainObject(o.icon)) {
this.icon = BI.createWidget(o.icon);
o.loading ? (this.icon.loading && this.icon.loading())
: (this.icon.loaded && this.icon.loaded());
} else {
// ReactUI 自定义的 icon
if (!o.loading && BI.isObject(o.icon)) {
this.icon = o.icon;
if (!o.loading && BI.isFunction(o.icon)) {
this.icon = BI.createWidget({
type: "bi.layout",
});
o.icon(this.icon.element);
} else {
this.icon = BI.createWidget({
type: "bi.icon_label",

Loading…
Cancel
Save