解决element-ui el-backtop返回顶部组件无效问题
el-backtop绑定的盒子,需要一个滚动样式:overflow-y: scroll;
<template>
<div id="app">
<router-view />
<!-- 绑定app盒子 -->
<el-backtop target="#app" :visibility-height="100" />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
"Microsoft YaHei", "微软雅黑", Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 100%;
height: 100%;
/* 这里给app一个滚动效果 */
overflow-y: scroll;
}
</style>
样式修改
// Backtop 回到顶部 返回页面顶部的操作按钮
.el-backtop, .el-calendar-table td.is-today {
color: #7055E4;
}
.el-backtop{
position: fixed;
right: 90px !important;
bottom: 90px !important;
// background-color: #DFE2FF;
}