scs-scroll-top.vue 643 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <uni-transition name="fade" :duration="300" :show="isShowToTop">
  3. <image src="https://www.mescroll.com/img/mescroll-totop.png" class="scroll-totop" @click="goTop" />
  4. </uni-transition>
  5. </template>
  6. <script>
  7. export default {
  8. props: {
  9. isShowToTop: {
  10. type: Boolean,
  11. default: false,
  12. },
  13. },
  14. methods: {
  15. goTop() {
  16. this.$emit('goTop')
  17. },
  18. },
  19. }
  20. </script>
  21. <style lang="scss" scoped>
  22. .scroll-totop {
  23. position: fixed;
  24. bottom: 80rpx;
  25. right: 50rpx;
  26. width: 72rpx;
  27. height: 72rpx;
  28. z-index: 999;
  29. border-radius: 50%;
  30. }
  31. </style>