Skip to content
On this page

BackTop 回到顶部

基本使用

回到顶部的基础用法

显示代码
html
<n-back-top>Top</n-back-top>

位置偏移

bottomright 属性可以配置距离右边和下边的距离

显示代码
html
<n-back-top bottom="150px" right="120px">Go</n-back-top>

插入 Icon

显示代码
html
<n-back-top bottom="100px">
  <n-icon name="vertical-align-top" color="#409eff" />
</n-back-top>

API

参数说明类型可选值默认值
bottom距离下面的距离string——'50px'
right距离右面的距离string——'50px'
behavior滚动模式string['smooth' , 'auto']'smooth'
beyond超出 xx 范围显示number——100