<template>
<el-dialog
v-dialogDrag :append-to-body="true"
:before-close="close"
top="5vh" >
<el-card
v-loading="executeFlag"
class="hqlcard"
>
<div class="wraper">
<el-backtop class="backtop" target=".wraper" :bottom="150" :right="100">
<div class="page-up">
<i class="el-icon-caret-top"></i>
</div>
</el-backtop>
<pre>{{contentHtml}}</pre>
</div>
</el-card>
</el-dialog>
</template>
<style scoped>
.wraper {
height: 450px;
overflow-x: scroll;
overflow-y: scroll;
}
//设置父亲 相对 定位
.hqlcard .el-card__body{
position: relative;
}
//设置儿子 绝对定位 同时 设置 bottom: 10px; right: 10px;
.backtop{
position: absolute;
bottom: 10px;
right: 10px;
/*z-index: 999;*/ 有可能这个 控件 在底层 点击 的时候 触发不到 ,所以设置最高
}
.page-up {
background-color: #409eff;
width: 40px;
height: 40px;
border-radius: 20px;
cursor: pointer;
opacity: .5;
transition: .3s;
box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
}
.el-icon-caret-top{
color: #fff;
display: block;
line-height: 40px;
text-align: center;
font-size: 18px;
}
</style>