<template>
	<view class="top" :style="{'display':(showToTop===true? 'block':'none')}">
	  <view class="topc icon iconfont icon-huidaodingbu"  @tap="top"></view>
	</view>
</template>

<script>
	export default{
		props:{
			showToTop:Boolean
		},
		methods:{
			top() { //回到顶部
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			}
		}
	}
</script>

<style scoped>
	.top {
		position: relative;
		display: none; /* 先将元素隐藏 */
	}
	.topc {
		position: fixed;
		right: 0;
		background: #F0F0F0;
		top: 70%;
		height: 50px;
		line-height: 50px;
	}
</style>
