Browse Source

无JIRA tab的showIndex 响应式也支持false的时候不进行创建

es6
zsmj 2 years ago
parent
commit
b6afaadf0a
  1. 23
      src/base/combination/tab.js

23
src/base/combination/tab.js

@ -86,15 +86,18 @@ BI.Tab = BI.inherit(BI.Widget, {
created: function () {
var self = this, o = this.options;
if (o.showIndex !== false) {
if (BI.isFunction(o.showIndex)) {
var v = this.__watch(o.showIndex, function (context, newValue) {
self.setSelect(newValue);
});
this.setSelect(v);
} else {
this.setSelect(o.showIndex);
}
var showIndex;
if (BI.isFunction(o.showIndex)) {
showIndex = this.__watch(o.showIndex, function (context, newValue) {
self.setSelect(newValue);
});
} else {
showIndex = o.showIndex;
}
if (showIndex !== false) {
this.setSelect(showIndex);
}
},
@ -135,7 +138,7 @@ BI.Tab = BI.inherit(BI.Widget, {
getTab: function (v) {
this._assertCard(v);
return this.layout.getCardByName(v);
return this.layout.getCardByName(v);
},
setValue: function (v) {

Loading…
Cancel
Save