imageText.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="imageText warp" :class="['terminal'+terminal,'pos-' + componentContent.positionValue]">
  3. <div class="img img-left">
  4. <a class="a-link" @click="jumpLink(componentContent.linkObj)"><img :src="componentContent.imageUrl" alt=""></a>
  5. </div>
  6. <div class="text">
  7. <h3 class="h3">{{componentContent.title}}</h3>
  8. <div v-html="componentContent.content"></div>
  9. </div>
  10. <div class="img img-right">
  11. <a class="item a-link" @click="jumpLink(componentContent.linkObj)"><img :src="componentContent.imageUrl" alt=""></a>
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import {funMixin} from '../config/mixin'
  17. export default {
  18. name: 'imageTextComponent',
  19. mixins: [funMixin],
  20. data () {
  21. return {
  22. }
  23. },
  24. props: {
  25. terminal: {
  26. type: Number,
  27. default: 4
  28. },
  29. componentContent: {
  30. type: Object
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss" scoped>
  36. .imageText{
  37. display: flex;
  38. justify-content: space-between;
  39. align-items: center;
  40. padding: 20px 0;
  41. .img{
  42. width: 50%;
  43. padding-bottom: 30%;
  44. background-color: #cacaca;
  45. position: relative;
  46. img{
  47. max-width: 100%;
  48. height: 100%;
  49. max-height: 100%;
  50. position: absolute;
  51. margin: auto;
  52. top: 0;
  53. right: 0;
  54. bottom: 0;
  55. left: 0;
  56. }
  57. }
  58. .text{
  59. width: 40%;
  60. .h3{
  61. font-size: 30px;
  62. margin-bottom: 24px;
  63. }
  64. .p{
  65. font-size: 16px;
  66. }
  67. }
  68. &.pos-top{
  69. display: block;
  70. text-align: center;
  71. .img{
  72. width: 100%;
  73. }
  74. .text{
  75. width: 100%;
  76. margin-top: 30px;
  77. }
  78. .img-right{
  79. display: none;
  80. }
  81. }
  82. &.pos-bottom{
  83. display: block;
  84. text-align: center;
  85. .img{
  86. width: 100%;
  87. }
  88. .text{
  89. width: 100%;
  90. margin-bottom: 30px;
  91. }
  92. .img-left{
  93. display: none;
  94. }
  95. }
  96. &.pos-left{
  97. .img-right{
  98. display: none;
  99. }
  100. }
  101. &.pos-right{
  102. .text{
  103. padding-left: 20px;
  104. }
  105. .img-left{
  106. display: none;
  107. }
  108. }
  109. }
  110. </style>