From fe3f110085946d88c743c09826bd0b09a4a2e1cb Mon Sep 17 00:00:00 2001 From: afc163 Date: Sun, 28 Oct 2018 20:57:23 +0800 Subject: [PATCH] does: update button api documentation --- components/button/index.en-US.md | 4 +++- components/button/index.zh-CN.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/button/index.en-US.md b/components/button/index.en-US.md index a42a60151a..115ca2375e 100644 --- a/components/button/index.en-US.md +++ b/components/button/index.en-US.md @@ -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. + `` will be rendered into ``, and all the properties which are not listed above will be transferred to the `` will be rendered into `Hello world!`. diff --git a/components/button/index.zh-CN.md b/components/button/index.zh-CN.md index 7dfb2ef7a3..c8313f23a5 100644 --- a/components/button/index.zh-CN.md +++ b/components/button/index.zh-CN.md @@ -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 的其他所有属性。 + +`` 最终会被渲染为 ``,并且除了上表中的属性,其它属性都会直接传到原生 button 上。 `` 则会渲染为 `Hello world!`。