MCSM:Tabs: callback функции выполняются после переключения вкладок
This commit is contained in:
@@ -59,14 +59,15 @@ var Tabs = React.createClass({
|
|||||||
return ce('div', (i !== _this.state.activeTab ? {style: {display: 'none'}} : null), child);
|
return ce('div', (i !== _this.state.activeTab ? {style: {display: 'none'}} : null), child);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.props.stateCallback !== null) {
|
|
||||||
this.props.stateCallback(this.state.activeTab);
|
|
||||||
}
|
|
||||||
|
|
||||||
return(ce('div', null,
|
return(ce('div', null,
|
||||||
ce('ul', {className: 'nav nav-tabs', id: 'tabs'}, tabsElm),
|
ce('ul', {className: 'nav nav-tabs', id: 'tabs'}, tabsElm),
|
||||||
showElement
|
showElement
|
||||||
))
|
))
|
||||||
|
},
|
||||||
|
componentDidUpdate: function() {
|
||||||
|
if (this.props.stateCallback !== null) {
|
||||||
|
this.props.stateCallback(this.state.activeTab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user