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滚动距离达到该值后显示按钮number200
right距右侧距离number / string40
bottom距底部距离number / string40
class-name / style根元素类名与样式string / object—

Backtop Events

事件名说明参数
onClick点击时触发Function

Backtop Slots

插槽名说明React 写法
default自定义内容children