props.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('backtop', {
  3. // 返回顶部的形状,circle-圆形,square-方形
  4. mode: {
  5. type: String,
  6. default: 'circle',
  7. },
  8. // 自定义图标
  9. icon: {
  10. type: String,
  11. default: 'arrow-upward',
  12. },
  13. // 提示文字
  14. text: {
  15. type: String,
  16. default: '',
  17. },
  18. // 返回顶部滚动时间
  19. duration: {
  20. type: [String, Number],
  21. default: 100,
  22. },
  23. // 滚动距离
  24. scrollTop: {
  25. type: [String, Number],
  26. default: 0,
  27. },
  28. // 距离顶部多少距离显示,单位px
  29. top: {
  30. type: [String, Number],
  31. default: 400,
  32. },
  33. // 返回顶部按钮到底部的距离,单位px
  34. bottom: {
  35. type: [String, Number],
  36. default: 100,
  37. },
  38. // 返回顶部按钮到右边的距离,单位px
  39. right: {
  40. type: [String, Number],
  41. default: 20,
  42. },
  43. // 层级
  44. zIndex: {
  45. type: [String, Number],
  46. default: 9,
  47. },
  48. // 图标的样式,对象形式
  49. iconStyle: {
  50. type: Object,
  51. default: () => ({
  52. color: '#909399',
  53. fontSize: '19px',
  54. }),
  55. },
  56. });