<template>
  <div class="fixbox" @click="up">
    <img src="../assets/up.png" alt="" class="up-img" />
  </div>
</template>

<script>
export default {
  name: "Totop",
  methods: {
    up() {
      document.body.scrollTop = document.documentElement.scrollTop = 0;
    },
  },
};
</script>

<style lang="scss" scoped>
.fixbox {
  position: fixed;
  right: 20px;
  bottom: 30px;
  .up-img {
    width: 60px;
    height: 60px;
  }
}
</style>