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

Loading…
Cancel
Save