basicCard.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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(()=>props.cardContentList,(newV,oldV)=>{
  24. console.log(newV,'工作面卡片-----')
  25. cardContentLists.value=newV
  26. },{immediate:true,deep:true})
  27. </script>
  28. <style lang="less" scoped>
  29. .basicCard {
  30. position: relative;
  31. width: 100%;
  32. height: 100%;
  33. display: flex;
  34. justify-content: space-between;
  35. align-items: center;
  36. background-color: rgba(41, 49, 53, .6);
  37. overflow-x: auto;
  38. .card-box {
  39. width: 416px;
  40. height: 100%;
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. flex-shrink: 0;
  45. border-left: 2px solid;
  46. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  47. &:first-child {
  48. border: none;
  49. }
  50. .card-box-img {
  51. width: 94px;
  52. height: 94px;
  53. }
  54. .card-box-item {
  55. height: 94px;
  56. margin-left: 10px;
  57. display: flex;
  58. flex-direction: column;
  59. justify-content: space-around;
  60. .item-labels {
  61. color: #fff
  62. }
  63. .item-vals {
  64. font-family: 'douyuFont';
  65. font-size: 20px;
  66. color: #02bbe9;
  67. }
  68. }
  69. }
  70. }</style>