Backtop 回到顶部
返回页面顶部的操作按钮。
基础用法
通过滑动来查看容器右下角的按钮。
Scroll down to see the bottom-right button.
自定义内容
显示区域被固定为 40px * 40px 的区域,其中的内容可支持自定义。
Scroll down to see the bottom-right button.
Backtop API
Backtop Attributes
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| target | 触发滚动的容器选择器,省略时为文档 | string | — |
| visibility-height | 滚动距离达到该值后显示按钮 | number | 200 |
| right | 距右侧距离 | number / string | 40 |
| bottom | 距底部距离 | number / string | 40 |
| class-name / style | 根元素类名与样式 | string / object | — |
Backtop Events
| 事件名 | 说明 | 参数 |
|---|---|---|
| onClick | 点击时触发 | Function |
Backtop Slots
| 插槽名 | 说明 | React 写法 |
|---|---|---|
| default | 自定义内容 | children |