You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.9 KiB

5 months ago
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 开始的数值,默认从0增长到某一个数
  6. startVal: {
  7. type: [String, Number],
  8. default: () => defProps.countTo.startVal
  9. },
  10. // 要滚动的目标数值,必须
  11. endVal: {
  12. type: [String, Number],
  13. default: () => defProps.countTo.endVal
  14. },
  15. // 滚动到目标数值的动画持续时间,单位为毫秒(ms)
  16. duration: {
  17. type: [String, Number],
  18. default: () => defProps.countTo.duration
  19. },
  20. // 设置数值后是否自动开始滚动
  21. autoplay: {
  22. type: Boolean,
  23. default: () => defProps.countTo.autoplay
  24. },
  25. // 要显示的小数位数
  26. decimals: {
  27. type: [String, Number],
  28. default: () => defProps.countTo.decimals
  29. },
  30. // 是否在即将到达目标数值的时候,使用缓慢滚动的效果
  31. useEasing: {
  32. type: Boolean,
  33. default: () => defProps.countTo.useEasing
  34. },
  35. // 十进制分割
  36. decimal: {
  37. type: [String, Number],
  38. default: () => defProps.countTo.decimal
  39. },
  40. // 字体颜色
  41. color: {
  42. type: String,
  43. default: () => defProps.countTo.color
  44. },
  45. // 字体大小
  46. fontSize: {
  47. type: [String, Number],
  48. default: () => defProps.countTo.fontSize
  49. },
  50. // 是否加粗字体
  51. bold: {
  52. type: Boolean,
  53. default: () => defProps.countTo.bold
  54. },
  55. // 千位分隔符,类似金额的分割(¥23,321.05中的",")
  56. separator: {
  57. type: String,
  58. default: () => defProps.countTo.separator
  59. }
  60. }
  61. })