doc: update divider doc and demo

This commit is contained in:
afc163 2018-04-03 14:25:47 +08:00
parent 779a35e4cc
commit cab162b562
5 changed files with 36 additions and 7 deletions

View File

@ -29,13 +29,18 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
</p>
</div>
`;
exports[`renders ./components/divider/demo/orientation.md correctly 1`] = `
<div>
<div
class="ant-divider ant-divider-horizontal ant-divider-with-text-left"
>
<span
class="ant-divider-inner-text"
>
With Text
Left Text
</span>
</div>
<p>
@ -47,7 +52,7 @@ exports[`renders ./components/divider/demo/horizontal.md correctly 1`] = `
<span
class="ant-divider-inner-text"
>
With Text
Right Text
</span>
</div>
<p>

View File

@ -25,10 +25,6 @@ ReactDOM.render(
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
<Divider dashed />
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
<Divider orientation="left">With Text</Divider>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
<Divider orientation="right">With Text</Divider>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
</div>
, mountNode);
````

View File

@ -0,0 +1,27 @@
---
order: 2
title:
zh-CN: 标题位置
en-US: Orientation of title
---
## zh-CN
修改分割线标题的位置。
## en-US
Set orientation of divider to left or right.
````jsx
import { Divider } from 'antd';
ReactDOM.render(
<div>
<Divider orientation="left">Left Text</Divider>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
<Divider orientation="right">Right Text</Divider>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.</p>
</div>
, mountNode);
````

View File

@ -20,4 +20,4 @@ A divider line separates different content.
| -------- | ----------- | ---- | ------- |
| dashed | whether line is dashed | Boolean | false |
| type | direction type of divider | enum: `horizontal` `vertical` | `horizontal` |
| orientation | this is optional, if not set it will have the text in the center | enum: `left` `right` | `center` |
| orientation | position of title inside divider | enum: `left` `right` `center` | `center` |

View File

@ -18,3 +18,4 @@ subtitle: 分割线
| --- | --- | --- | --- |
| dashed | 是否虚线 | Boolean | false |
| type | 水平还是垂直类型 | enum: `horizontal` `vertical` | `horizontal` |
| orientation | 分割线标题的位置 | enum: `left` `right` | `center` |