-
Notifications
You must be signed in to change notification settings - Fork 80
/
app.js
32 lines (30 loc) · 1015 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/** @jsx React.DOM */
'use strict';
var Tabs = ReactSimpleTabs;
var App = React.createClass({
onMount: function(selectedIndex, $selectedPanel, $selectedTabMenu) {
console.log('on mount, showing tab ' + selectedIndex);
},
onBeforeChange: function(selectedIndex, $selectedPanel, $selectedTabMenu) {
console.log('before the tab ' + selectedIndex);
},
onAfterChange: function(selectedIndex, $selectedPanel, $selectedTabMenu) {
console.log('after the tab ' + selectedIndex);
},
render: function() {
return (
<Tabs tabActive={2} onBeforeChange={this.onBeforeChange} onAfterChange={this.onAfterChange} onMount={this.onMount}>
<Tabs.Panel title='Tab #1'>
<h2>Content #1</h2>
</Tabs.Panel>
<Tabs.Panel title='Tab #2'>
<h2>Content #2</h2>
</Tabs.Panel>
<Tabs.Panel title='Tab #3'>
<h2>Content #3</h2>
</Tabs.Panel>
</Tabs>
);
}
});
React.renderComponent(<App />, document.getElementById('tabs'));