index.vue 648 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <a
  3. class="scroll-top"
  4. href="javascript:;"
  5. @click="$emit('handleScrollTop')">
  6. <van-icon
  7. :color="'#333'"
  8. name="arrow-up"/>
  9. </a>
  10. </template>
  11. <script>
  12. import { Icon } from 'vant'
  13. export default {
  14. name: 'index',
  15. components: {
  16. 'van-icon': Icon
  17. }
  18. }
  19. </script>
  20. <style lang="scss" scoped>
  21. .scroll-top {
  22. position: absolute;
  23. bottom: 20px;
  24. right: 10px;
  25. z-index: 10;
  26. display: flex;
  27. justify-content: center;
  28. align-items: center;
  29. width: 50px;
  30. height: 50px;
  31. border-radius: 50%;
  32. background: #fff;
  33. box-shadow: 0 0 10px 0 #ccc;
  34. ::v-deep .van-icon {
  35. font-size: 30px;
  36. }
  37. }
  38. </style>