imgCardLv3.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div class="mta-card-lv3">
  3. <div class="mta-card-content-pc mta-hidden-xs" :class="[img.order > contentOrder ? 'img-left': 'img-right']">
  4. <img :style="`order:${img.order}`" :src="img.url">
  5. <div class="card-info" :style="`order: ${contentOrder}`">
  6. <h5>{{ title }}</h5>
  7. <p>{{des}}</p>
  8. <slot></slot>
  9. </div>
  10. </div>
  11. <div class="mta-card-content-h5 mta-hidden-sm">
  12. <img :src="img.url">
  13. <div class="card-info">
  14. <h5>{{ title }}</h5>
  15. <p>{{des}}</p>
  16. <slot></slot>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. export default {
  23. name: "imgCardLv3",
  24. props: {
  25. option: {
  26. type: Object,
  27. required: true,
  28. },
  29. },
  30. data() {
  31. return {}
  32. },
  33. computed: {
  34. img() {
  35. return {url: this.option.img.url, order: this.option.img.order}
  36. },
  37. title() {
  38. return this.option.content.title;
  39. },
  40. des() {
  41. return this.option.content.des;
  42. },
  43. contentOrder() {
  44. return this.option.content.order;
  45. },
  46. tagesPc() {
  47. return this.option.content.list;
  48. },
  49. tagesH5() {
  50. return this.option.content.list;
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .mta-card-lv3 {
  57. margin: 0 auto 120px;
  58. .mta-card-content-pc {
  59. display: flex;
  60. img {
  61. width: 480px;
  62. height: 370px;
  63. }
  64. }
  65. .img-left {
  66. img {
  67. margin-left: 100px;
  68. }
  69. }
  70. .img-right {
  71. img {
  72. margin-right: 100px;
  73. }
  74. }
  75. .card-info {
  76. h5 {
  77. font-size: 24px;
  78. font-weight: 800;
  79. text-align: left;
  80. color: #333;
  81. margin-top: 40px;
  82. margin-bottom: 23px;
  83. }
  84. p {
  85. font-size: 14px;
  86. font-weight: 800;
  87. color: #333;
  88. line-height: 24px;
  89. }
  90. }
  91. }
  92. </style>