VciChartTooltip.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="VciChartTooltip vci-fs-14">
  3. <strong class="ct-title vci-fs-16">{{ title }}</strong>
  4. <div
  5. v-if="list"
  6. class="ct-list"
  7. >
  8. <div
  9. v-for="(item, i) in listOp"
  10. :key="i"
  11. class="ci-item vci-flex-rml"
  12. >
  13. <span class="ci-name">{{ item.name }}</span>
  14. <NumberAnimation
  15. :enable-background="false"
  16. :numbers="item.value"
  17. :sp-three="true"
  18. class="ci-value vci-fw-bolder"
  19. height="16"
  20. width="8"
  21. />
  22. <strong class="ci-unit">{{ item.unit }}</strong>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. import VciNumberAnimation from "../text/VciNumberAnimation/VciNumberAnimation.vue";
  29. export default {
  30. name: "VciChartTooltip",
  31. components: { NumberAnimation: VciNumberAnimation },
  32. props: {
  33. title: {
  34. type: String,
  35. default: ""
  36. },
  37. list: {
  38. type: Array,
  39. default: null
  40. }
  41. },
  42. data() {
  43. return {};
  44. },
  45. computed: {
  46. listOp() {
  47. return this.list;
  48. }
  49. }
  50. };
  51. </script>
  52. <style lang="scss" scoped>
  53. .VciChartTooltip {
  54. font-family: "Microsoft YaHei UI Light", sans-serif;
  55. padding: 8 hpx 24px;
  56. background-color: rgba(0, 0, 0, 0.4);
  57. border-radius: 2px;
  58. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.8);
  59. backdrop-filter: blur(2px);
  60. color: #fff;
  61. line-height: 1;
  62. .ct-title {
  63. display: block;
  64. margin-bottom: 8px;
  65. }
  66. .ct-list {
  67. .ci-item {
  68. margin: 4 hpx 0;
  69. .ci-name {
  70. margin-right: 8px;
  71. }
  72. .ci-value {
  73. margin-right: 4px;
  74. }
  75. }
  76. }
  77. }
  78. </style>