hengmei-one/components/backTop.vue

38 lines
798 B
Vue
Raw Normal View History

2021-10-21 09:21:59 +00:00
<template>
<view>
<view v-if="showTop" class="backTop-box">
<image class="animated pulse infinite" @tap="backTop" src="/static/public/backTop.png"></image>
</view>
</view>
</template>
<script>
export default {
name:"backTop",
props:{
showTop:{
type:Boolean,
default:false
}
},
data() {
return {
};
},
onPageScroll(e) {
// console.log(e);
},
methods:{
backTop(){
this.$emit('backTop')
}
}
}
</script>
<style scoped>
.backTop-box{position: fixed;right: 20rpx;bottom: 160rpx;}
.backTop-box>image{width: 60rpx;height: 50rpx;}
</style>