Browse Source

优化布局

es6
guy 4 years ago
parent
commit
52abc4a1e4
  1. 34
      src/core/shortcut.js

34
src/core/shortcut.js

@ -56,24 +56,30 @@
if (item.type || options.type) { if (item.type || options.type) {
el = BI.extend({}, options, item); el = BI.extend({}, options, item);
w = BI.Plugin.getWidget(el.type, el); w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{ if (w.type === el.type) {
eventName: BI.Events.MOUNT, w.listeners = (w.listeners || []).concat([{
action: function () { eventName: BI.Events.MOUNT,
BI.Plugin.getObject(el.type, this); action: function () {
} BI.Plugin.getObject(el.type, this);
}]); }
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({/**important**/}, el, {type: w.type}), options, context, lazy); }]);
return createWidget(w, context, lazy);
}
return BI.createWidget(w, options, context, lazy);
} }
if (item.el && (item.el.type || options.type)) { if (item.el && (item.el.type || options.type)) {
el = BI.extend({}, options, item.el); el = BI.extend({}, options, item.el);
w = BI.Plugin.getWidget(el.type, el); w = BI.Plugin.getWidget(el.type, el);
w.listeners = (w.listeners || []).concat([{ if (w.type === el.type) {
eventName: BI.Events.MOUNT, w.listeners = (w.listeners || []).concat([{
action: function () { eventName: BI.Events.MOUNT,
BI.Plugin.getObject(el.type, this); action: function () {
} BI.Plugin.getObject(el.type, this);
}]); }
return w.type === el.type ? createWidget(w, context, lazy) : BI.createWidget(BI.extend({/**important**/}, el, {type: w.type}), options, context, lazy); }]);
return createWidget(w, context, lazy);
}
return BI.createWidget(w, options, context, lazy);
} }
if (BI.isWidget(item.el)) { if (BI.isWidget(item.el)) {
return item.el; return item.el;

Loading…
Cancel
Save