添加回到顶部代码
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
转发
|
||||
</span>
|
||||
<transmit-btn v-if="data.data['info']" :qrcode="data.data['qrcode']"
|
||||
:title="data.data.info['title']"></transmit-btn>
|
||||
:title="data.data.info['subject']"></transmit-btn>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
40
src/components/public/backToTop.vue
Normal file
40
src/components/public/backToTop.vue
Normal file
@@ -0,0 +1,40 @@
|
||||
<template>
|
||||
<div class="returnTop flexcenter" @click="screenroll()">
|
||||
<img class="icon" src="@/assets/img/publicImage/back-icon.png">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const screenroll = () => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth"
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@media screen and (max-width: 1360px) {
|
||||
.returnTop {
|
||||
right: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.returnTop {
|
||||
position: fixed;
|
||||
right: calc((100vw - 1200px) / 2 - 75px);
|
||||
bottom: 18px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: #323232;
|
||||
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.11764706);
|
||||
border-radius: 50%;
|
||||
z-index: 10;
|
||||
cursor: pointer;
|
||||
|
||||
.icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user