mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
does: update button api documentation
This commit is contained in:
parent
a0e693ebb8
commit
fe3f110085
@ -26,9 +26,11 @@ To get a customized button, just set `type`/`shape`/`size`/`loading`/`disabled`.
|
||||
| size | can be set to `small` `large` or omitted | string | `default` |
|
||||
| target | same as target attribute of a, works when href is specified | string | - |
|
||||
| type | can be set to `primary` `ghost` `dashed` `danger`(added in 2.7) or omitted (meaning `default`) | string | `default` |
|
||||
| onClick | set the handler to handle `click` event | function | - |
|
||||
| onClick | set the handler to handle `click` event | (event) => void | - |
|
||||
| block | option to fit button width to its parent width | boolean | `false` |
|
||||
|
||||
It accepts all props which native button support.
|
||||
|
||||
`<Button>Hello world!</Button>` will be rendered into `<button><span>Hello world!</span></button>`, and all the properties which are not listed above will be transferred to the `<button>` tag.
|
||||
|
||||
`<Button href="http://example.com">Hello world!</Button>` will be rendered into `<a href="http://example.com"><span>Hello world!</span></a>`.
|
||||
|
@ -29,10 +29,12 @@ subtitle: 按钮
|
||||
| size | 设置按钮大小,可选值为 `small` `large` 或者不设 | string | `default` |
|
||||
| target | 相当于 a 链接的 target 属性,href 存在时生效 | string | - |
|
||||
| type | 设置按钮类型,可选值为 `primary` `dashed` `danger`(版本 2.7 中增加) 或者不设 | string | - |
|
||||
| onClick | `click` 事件的 handler | function | - |
|
||||
| onClick | 点击按钮时的回调 | (event) => void | - |
|
||||
| block | 将按钮宽度调整为其父宽度的选项 | boolean | `false` |
|
||||
|
||||
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到 `<button></button>`。
|
||||
支持原生 button 的其他所有属性。
|
||||
|
||||
`<Button>Hello world!</Button>` 最终会被渲染为 `<button><span>Hello world!</span></button>`,并且除了上表中的属性,其它属性都会直接传到原生 button 上。
|
||||
|
||||
`<Button href="http://example.com">Hello world!</Button>` 则会渲染为 `<a href="http://example.com"><span>Hello world!</span></a>`。
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user