()
| 5 | |
| 6 | module.exports = class extends React.Component { |
| 7 | render () { |
| 8 | return ( |
| 9 | <div> |
| 10 | <div className="header"> |
| 11 | <h1>Button</h1> |
| 12 | <h2>按钮</h2> |
| 13 | </div> |
| 14 | |
| 15 | <div className="content button-docs"> |
| 16 | <Code> |
| 17 | {`<Button |
| 18 | className={string} // class |
| 19 | type="submit|button" // 按钮类型,可选值为 submit|button ,不填默认值为 button |
| 20 | disabled={bool} // 与 button 的 disabled 属性相同 |
| 21 | once={bool} // 值为 true 时,当button点击过后,状态会变更为 disabled |
| 22 | status="string" // primary|success|warning|error|info |
| 23 | onClick={function}> // 点击事件 |
| 24 | {string|element} // 文字或元素 |
| 25 | </Button>`} |
| 26 | </Code> |
| 27 | |
| 28 | <h2 className="subhead">普通按钮</h2> |
| 29 | <Example> |
| 30 | <Button status="primary">Primary Button</Button> |
| 31 | <Button>Button</Button> |
| 32 | </Example> |
| 33 | |
| 34 | <h2 className="subhead">带图标按钮</h2> |
| 35 | <Example> |
| 36 | <Button><Icon icon="home" /> Home</Button> |
| 37 | <Button><Icon icon="cog" /> Settings</Button> |
| 38 | </Example> |
| 39 | |
| 40 | <h2 className="subhead">Status</h2> |
| 41 | <Example> |
| 42 | <Button status="primary">Primary</Button> |
| 43 | <Button status="success">Success</Button> |
| 44 | <Button status="warning">Warning</Button> |
| 45 | <Button status="error">Error</Button> |
| 46 | <Button status="info">Info</Button> |
| 47 | <Button>Normal Button</Button> |
| 48 | </Example> |
| 49 | |
| 50 | <p>需要扩展可以添加className</p> |
| 51 | <Example> |
| 52 | <Button className="button-large">Large Button</Button> |
| 53 | </Example> |
| 54 | |
| 55 | <h2 className="subhead">once</h2> |
| 56 | <Example> |
| 57 | <Button once={true}>只能点击一次</Button> |
| 58 | </Example> |
| 59 | |
| 60 | <h2 className="subhead">disabled</h2> |
| 61 | <Example> |
| 62 | <Button disabled>Disabled Button</Button> |
| 63 | </Example> |
| 64 | </div> |
nothing calls this directly
no outgoing calls
no test coverage detected