Blame view

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