Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

65 linhas
2.0 KiB

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