1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/iflegend-v-format-table

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
index.js 1.4 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Vanch Отправлено 17.09.2017 07:58 0a4915a
/**
* @author Vanch
*/
(function() {
'use strict';
var tabContent;
window.Check = React.createClass({
getInitialState:function(){
var count =3;
return {
tabIndex:0
};
},
componentDidMount:function(){
ReactDOM.render(
<Table1/>,
document.getElementById('my-tab-content')
);
},
tabChanged:function(index){
if(this.state.tabIndex == index){
//do nothing
}else{
var elem = document.getElementById('my-tab-content');
if(tabContent){
ReactDOM.unmountComponentAtNode(elem);
}
if(index == 0){
ReactDOM.render(
<Table1/>,
document.getElementById('my-tab-content')
);
}else if(index == 1){
ReactDOM.render(
<Table2/>,
document.getElementById('my-tab-content')
);
}else if(index == 2){
ReactDOM.render(
<Table3/>,
document.getElementById('my-tab-content')
);
}else{
ReactDOM.render(
<Table1/>,
document.getElementById('my-tab-content')
);
}
this.state.tabIndex = index;
}
},
render: function() {
return (
<div>
<h1>V-Format-Table</h1>
<br/>
<CommonTabs data={[{name:"Table1"}, {name:"Table2"}, {name:"Table3"}]} callback={this.tabChanged}></CommonTabs>
<br/>
<div id="my-tab-content" className="tab-content">
</div>
</div>
);
}
});
ReactDOM.render(
<Check/>,
document.getElementById('container')
);
})(Zepto);

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/iflegend-v-format-table.git
git@api.gitlife.ru:oschina-mirror/iflegend-v-format-table.git
oschina-mirror
iflegend-v-format-table
iflegend-v-format-table
master