2018-04-03 14:25:47 +08:00
|
|
|
---
|
2019-06-15 20:28:43 +08:00
|
|
|
order: 1
|
2018-04-03 14:25:47 +08:00
|
|
|
title:
|
2019-06-15 20:28:43 +08:00
|
|
|
zh-CN: 带文字的分割线
|
|
|
|
en-US: Divider with title
|
2018-04-03 14:25:47 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
2019-06-15 20:28:43 +08:00
|
|
|
分割线中带有文字,可以用 `orientation` 指定文字位置。
|
2018-04-03 14:25:47 +08:00
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2019-06-15 20:28:43 +08:00
|
|
|
Divider with inner title, set `orientation="left/right"` to align it.
|
2018-04-03 14:25:47 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2018-04-03 14:25:47 +08:00
|
|
|
import { Divider } from 'antd';
|
2022-05-23 14:37:16 +08:00
|
|
|
import React from 'react';
|
2018-04-03 14:25:47 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => (
|
2020-04-21 14:16:33 +08:00
|
|
|
<>
|
2019-06-15 20:28:43 +08:00
|
|
|
<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>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>
|
2018-04-03 14:25:47 +08:00
|
|
|
<Divider orientation="left">Left Text</Divider>
|
2019-05-07 14:57:32 +08:00
|
|
|
<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>
|
2018-04-03 14:25:47 +08:00
|
|
|
<Divider orientation="right">Right Text</Divider>
|
2019-05-07 14:57:32 +08:00
|
|
|
<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>
|
2021-09-19 11:28:45 +08:00
|
|
|
<Divider orientation="left" orientationMargin="0">
|
|
|
|
Left Text with 0 orientationMargin
|
|
|
|
</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" orientationMargin={50}>
|
|
|
|
Right Text with 50px orientationMargin
|
|
|
|
</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>
|
2022-04-03 23:27:45 +08:00
|
|
|
</>
|
2018-11-28 15:00:03 +08:00
|
|
|
);
|
2022-05-19 09:46:26 +08:00
|
|
|
|
|
|
|
export default App;
|
2019-05-07 14:57:32 +08:00
|
|
|
```
|