Skip to content

Commit

Permalink
doc: 更新文档
Browse files Browse the repository at this point in the history
  • Loading branch information
easonchiu committed May 14, 2021
1 parent 58ff791 commit 6ff179d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion components/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Button: React.FC<ButtonProps> = props => {
'x-button--mini': mini,
'x-button--capsule': capsule,
'x-button--hollow': hollow,
'x-button--lighter': lighter || type === 'lighter',
'x-button--lighter': type !== 'default' && lighter,
'x-button--shrink': shrink !== void 0 ? shrink : !!mini,
'x-button--shadow':
(type === 'primary' || type === 'danger' || type === 'secondary') && !hollow && shadow,
Expand Down
26 changes: 14 additions & 12 deletions components/button/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ code=[disabled](button_disabled)

## 支持属性

| 属性 | 说明 | 类型 | 默认值 |
| -------- | ----------------------------------------------------------- | -------- | ---------------------------------------- |
| type | 按钮的种类,primary / secondary / lighter/ danger / default | String | primary |
| shadow | 按钮投影,只有类型为 primary / secondary / danger 时才有 | Boolean | false |
| onClick | 点击事件(按钮类型为 button) | Function | - |
| to | 跳转路由(按钮类型为 Link) | String | - |
| href | 跳转 url(按钮类型为 a 标签) | String | - |
| mini | 是否使用小按钮 | Boolean | false |
| capsule | 是否使用胶囊按钮,即两头圆角的样式 | Boolean | true |
| loading | 是否为加载中状态 | Boolean | false |
| disabled | 是否不可用 | Boolean | false |
| shrink | 是否收缩到文字显示范围 | Boolean | mini 为 true 时该值为 true,否则为 false |
| 属性 | 说明 | 类型 | 默认值 |
| -------- | -------------------------------------------------------- | -------- | ---------------------------------------- |
| type | 按钮的种类,primary / secondary / danger / default | String | primary |
| shadow | 按钮投影,只有类型为 primary / secondary / danger 时才有 | Boolean | false |
| lighter | 轻按钮,只有类型为 primary / secondary / danger 时才有 | Boolean | false |
| hollow | 空心按钮,只有类型为 primary / secondary / danger 时才有 | Boolean | false |
| onClick | 点击事件(按钮类型为 button) | Function | - |
| to | 跳转路由(按钮类型为 Link) | String | - |
| href | 跳转 url(按钮类型为 a 标签) | String | - |
| mini | 是否使用小按钮 | Boolean | false |
| capsule | 是否使用胶囊按钮,即两头圆角的样式 | Boolean | true |
| loading | 是否为加载中状态 | Boolean | false |
| disabled | 是否不可用 | Boolean | false |
| shrink | 是否收缩到文字显示范围 | Boolean | mini 为 true 时该值为 true,否则为 false |
14 changes: 13 additions & 1 deletion wiki_src/src/pages/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export default Demo
</thead>
<tbody><tr>
<td>type</td>
<td>按钮的种类,primary / secondary / lighter/ danger / default</td>
<td>按钮的种类,primary / secondary / danger / default</td>
<td>String</td>
<td>primary</td>
</tr>
Expand All @@ -388,6 +388,18 @@ export default Demo
<td>false</td>
</tr>
<tr>
<td>lighter</td>
<td>轻按钮,只有类型为 primary / secondary / danger 时才有</td>
<td>Boolean</td>
<td>false</td>
</tr>
<tr>
<td>hollow</td>
<td>空心按钮,只有类型为 primary / secondary / danger 时才有</td>
<td>Boolean</td>
<td>false</td>
</tr>
<tr>
<td>onClick</td>
<td>点击事件(按钮类型为 button)</td>
<td>Function</td>
Expand Down

0 comments on commit 6ff179d

Please sign in to comment.