 <template>
    <section class="back-top">
        <div class="back-btn" @click="backTop">
            <img src="../../images/backTop.png"/>
        </div>
      
    </section>
</template>

<script>
    export default {
    	data(){
            return{
               
            }
        },
        mounted(){
            
        },
  
        methods: {
            backTop:function(){
                var osTop = document.documentElement.scrollTop || document.body.scrollTop; 
                if(osTop > 0){
                    document.documentElement.scrollTop = document.body.scrollTop = 0;
                }
                

            }
            
        },
    }
</script>

<style lang="scss" scoped>
    @import '../../style/mixin';
	.back-btn{
        position: fixed;
        width: px2rem(35px);
        height: px2rem(35px);
        right: px2rem(15px);
        z-index: 100;
        bottom: px2rem(80px);;
        img{
            width: 100%;
            height: 100%;
            display: block;
        }

    }
    
</style>

