Skip to content

BackTop 返回顶部 ​

uvx-back-top 在滚动超过阈值时提供返回顶部操作。

平台兼容性 ​

AndroidiOS鸿蒙H5微信
3.9+4.11+4.61+4.0+4.41+

基础用法 ​

vue
<uvx-back-top :scroll-top="0"></uvx-back-top>

API ​

Props ​

属性说明类型默认值
mode按钮形状circle | squarecircle
icon图标名称或图片路径stringarrow-upward
text按钮文字string""
duration页面回顶动画时长(由页面使用)number100
scroll-top父页面传入的当前滚动距离number0
top超过该滚动距离显示,单位 pxnumber400
bottom / right距底部和右侧距离,单位 pxnumber100 / 20
z-index层级number9
icon-style图标自定义样式,CSS 字符串string""
u-style根节点自定义样式string""

Events ​

事件说明参数
click点击按钮;页面需在回调中将滚动容器回到顶部-

组件仅根据 scroll-top > top 控制显示,点击不会自行修改页面滚动位置。

参考 ​

uvx-ui · uni-app x 组件库