Skip to content

Commit

Permalink
update back-top doc
Browse files Browse the repository at this point in the history
  • Loading branch information
afc163 committed Jun 24, 2016
1 parent 2007b21 commit bd5311c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
7 changes: 5 additions & 2 deletions components/back-top/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ order: 0
title: 基本
---

最简单的用法,demo 见右下角灰色按钮
最简单的用法。

````jsx
import { BackTop } from 'antd';

ReactDOM.render(
<BackTop />
<div>
<BackTop />
向下滚动后,见右下角灰色按钮
</div>
, mountNode);
````
18 changes: 9 additions & 9 deletions components/back-top/demo/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ order: 1
title: 自定义样式
---

可以自定义置顶按钮的样式,限制宽高: 40px * 40px。(右下角蓝色按钮)
可以自定义置顶按钮的样式,限制宽高`40px * 40px`

````jsx
import { BackTop } from 'antd';

const style = {
height: 40,
width: 40,
borderRadius: 3,
lineHeight: '40px',
borderRadius: 4,
backgroundColor: '#57c5f7',
color: '#fff',
textAlign: 'center',
fontSize: 20,
};

const onClick = (e) => {
console.log(e);
};

ReactDOM.render(
<BackTop onClick={onClick} style={{ bottom: 100 }}>
<div style={style}>UP</div>
</BackTop>
<div>
<BackTop style={{ bottom: 100 }}>
<div style={style}>UP</div>
</BackTop>
向下滚动后,见右下角蓝色按钮
</div>
, mountNode);
````
8 changes: 4 additions & 4 deletions components/back-top/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ type: Other
english: BackTop
---

使用 `BackTop` 可以方便地回到顶部
使用置顶组件可以方便地回到页面顶部

## 何时使用

当内容区域比较长,需要提供快速回到顶部的功能时。
- 当页面内容区域比较长时;
- 当用户需要频繁返回顶部查看相关内容时。

## API

> 有默认样式,距离底部 `50px`,可覆盖。
> 自定义样式宽高有限制,不大于 40px * 40px。
> 自定义样式宽高不大于 40px * 40px。
| 参数 | 说明 | 类型 | 默认值 |
|-------------|----------------|--------------------|--------------|
Expand Down

0 comments on commit bd5311c

Please sign in to comment.