props.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import { defineProps } from '../../libs/util/props';
  2. export default defineProps('amount', {
  3. // 金额数值
  4. value: {
  5. type: Number,
  6. default: null
  7. },
  8. // 金融符号
  9. symbol: {
  10. type: String,
  11. default: '¥'
  12. },
  13. // 是否置后金额符号位置
  14. reverse: {
  15. type: Boolean,
  16. default: false
  17. },
  18. // 数字精度,小数点后保留几位
  19. precision: {
  20. type: Number,
  21. default: 2
  22. },
  23. // 数字精度取舍是否四舍五入
  24. roundUp: {
  25. type: Boolean,
  26. default: true
  27. },
  28. // 数字变化是否使用动画
  29. transition: {
  30. type: Boolean,
  31. default: false
  32. },
  33. // 数字变化动画时长
  34. duration: {
  35. type: Number,
  36. default: 1000
  37. },
  38. // 分隔符位置 (3为千分位,4为万分位)
  39. separatorDigits: {
  40. type: Number,
  41. default: 4
  42. },
  43. // 分隔符
  44. separator: {
  45. type: String,
  46. default: ','
  47. },
  48. // 是否显示金融符号
  49. showSymbol: {
  50. type: Boolean,
  51. default: true
  52. },
  53. // 是否显示小数
  54. showDecimal: {
  55. type: Boolean,
  56. default: true
  57. },
  58. // 是否显示分隔符
  59. showSeparator: {
  60. type: Boolean,
  61. default: false
  62. },
  63. // 数字是否转换为大写中文
  64. capital: {
  65. type: Boolean,
  66. default: false
  67. },
  68. // 整数字体大小
  69. fontSize: {
  70. type: String,
  71. default: ''
  72. },
  73. // 金融符号小数与整数的比例或字体大小
  74. fontSizeRatio: {
  75. type: [String, Number],
  76. default: 0.7
  77. },
  78. // 颜色
  79. color: {
  80. type: String,
  81. default: ''
  82. },
  83. // 金融符号与小数字体颜色
  84. colorRatio: {
  85. type: String,
  86. default: ''
  87. },
  88. // 自定义样式
  89. customStyle: {
  90. type: Object,
  91. default: () => ({})
  92. }
  93. })