basicCard.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <div class="basicCard">
  3. <div class="card-box" v-for="(item, index) in cardContentLists" :key="index">
  4. <img class="card-box-img" :src="item.imgSrc" alt="" />
  5. <div class="card-box-item">
  6. <div class="item-labels">{{ item.label }}</div>
  7. <div class="item-vals">{{ item.val }}</div>
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script setup lang="ts">
  13. import { ref, reactive, defineProps, watch } from 'vue';
  14. let props = defineProps({
  15. cardContentList: {
  16. type: Array,
  17. default: () => {
  18. return [];
  19. },
  20. },
  21. });
  22. let cardContentLists = ref<any[]>([]);
  23. watch(
  24. () => props.cardContentList,
  25. (newV, oldV) => {
  26. console.log(newV, '工作面卡片-----');
  27. cardContentLists.value = newV;
  28. },
  29. { immediate: true, deep: true },
  30. );
  31. </script>
  32. <style lang="less" scoped>
  33. @font-face {
  34. font-family: douyuFont;
  35. src: url('../../../assets/font/douyuFont.otf');
  36. }
  37. .basicCard {
  38. display: flex;
  39. position: relative;
  40. align-items: center;
  41. justify-content: space-between;
  42. width: 100%;
  43. height: 100%;
  44. overflow-x: auto;
  45. background-color: rgb(41 49 53 / 80%);
  46. .card-box {
  47. display: flex;
  48. // width: 416px;
  49. flex: 1;
  50. flex-shrink: 0;
  51. align-items: center;
  52. justify-content: center;
  53. height: 100%;
  54. border-left: 2px solid;
  55. border-image: linear-gradient(to bottom, transparent, rgb(2 70 136 / 100%), transparent) 1 1 1;
  56. &:first-child {
  57. border: none;
  58. }
  59. .card-box-img {
  60. width: 94px;
  61. height: 94px;
  62. }
  63. .card-box-item {
  64. display: flex;
  65. flex-direction: column;
  66. justify-content: space-around;
  67. height: 94px;
  68. margin-left: 10px;
  69. .item-labels {
  70. color: #fff;
  71. font-size: 14px;
  72. }
  73. .item-vals {
  74. width: 100%;
  75. color: #02bbe9;
  76. // font-family: douyuFont;
  77. font-family: "Microsoft YaHei", sans-serif;
  78. font-size: 18px;
  79. font-weight: bold;
  80. text-align: center;
  81. }
  82. }
  83. }
  84. }
  85. </style>