NumberInfo.vue 975 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div :class="[prefixCls]">
  3. <slot name="subtitle">
  4. <div :class="[`${prefixCls}-subtitle`]">{{ typeof subTitle === 'string' ? subTitle : subTitle() }}</div>
  5. </slot>
  6. <div class="number-info-value">
  7. <span>{{ total }}</span>
  8. <span class="sub-total">
  9. {{ subTotal }}
  10. <icon :type="`caret-${status}`" />
  11. </span>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import Icon from 'ant-design-vue/es/icon'
  17. export default {
  18. name: 'NumberInfo',
  19. props: {
  20. prefixCls: {
  21. type: String,
  22. default: 'ant-pro-number-info'
  23. },
  24. total: {
  25. type: Number,
  26. required: true
  27. },
  28. subTotal: {
  29. type: Number,
  30. required: true
  31. },
  32. subTitle: {
  33. type: [String, Function],
  34. default: ''
  35. },
  36. status: {
  37. type: String,
  38. default: 'up'
  39. }
  40. },
  41. components: {
  42. Icon
  43. },
  44. data () {
  45. return {}
  46. }
  47. }
  48. </script>
  49. <style lang="less" scoped>
  50. @import "index";
  51. </style>