<template>
<div class="content">
<!-- 绑定content盒子 -->
<el-backtop target=".content" :bottom="100">
<div>UP</div>
</el-backtop>
</div>
</template>
.content {
height: 1000px;
overflow-y: scroll;//这个最重要
}
效果图

这篇博客展示了如何在Vue项目中结合Element-UI库,通过`el-backtop`组件实现页面滚动到一定位置后显示返回顶部按钮的功能。内容包括HTML模板的编写,CSS样式设置以及组件配置,帮助读者理解如何在实际开发中添加此类交互元素。
<template>
<div class="content">
<!-- 绑定content盒子 -->
<el-backtop target=".content" :bottom="100">
<div>UP</div>
</el-backtop>
</div>
</template>
.content {
height: 1000px;
overflow-y: scroll;//这个最重要
}
效果图


被折叠的 条评论
为什么被折叠?