| 58 | } |
| 59 | |
| 60 | render() { |
| 61 | return ( |
| 62 | <div> |
| 63 | <h3>Tab</h3> |
| 64 | <ul> |
| 65 | <li> |
| 66 | <h4>Default tab</h4> |
| 67 | <p>this will change next tab</p> |
| 68 | {this.formatTab({ onChange: this.displayChange.bind(this)})} |
| 69 | <pre> |
| 70 | <code> |
| 71 | {` |
| 72 | <Tab onChange={onChange}> |
| 73 | <Item index='0' title={<p>first</p>}> |
| 74 | <h4>The first tab content</h4> |
| 75 | </Item> |
| 76 | ... |
| 77 | <Item index='2' title={<p>third</p>}> |
| 78 | <h4>The third tab content</h4> |
| 79 | <Tab> |
| 80 | <Item index='4' title={<p>first</p>}> |
| 81 | <p>React.js is pretty awesome</p> |
| 82 | </Item> |
| 83 | ... |
| 84 | </Tab> |
| 85 | </Item> |
| 86 | </Tab> |
| 87 | `} |
| 88 | </code> |
| 89 | </pre> |
| 90 | </li> |
| 91 | <li> |
| 92 | <h4>Tab with given current tab</h4> |
| 93 | <p>your selected tab is {this.state.index}</p> |
| 94 | {this.formatTab({current: this.state.index, onChange: this.displayChange.bind(this) })} |
| 95 | <pre> |
| 96 | <code> |
| 97 | {` |
| 98 | <Tab current={current} onChange={onChange}> |
| 99 | ... |
| 100 | </Tab> |
| 101 | `} |
| 102 | </code> |
| 103 | </pre> |
| 104 | </li> |
| 105 | </ul> |
| 106 | </div> |
| 107 | ); |
| 108 | } |
| 109 | } |