Blame view

pc-master/src/components/canvasShow/basics/imageTextNav.vue 2.13 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
  <template>
    <ul class="ul image-text-nav" :class="'terminal' + terminal">
      <li class="li" v-for="(item,index) in componentContent.imgTextData" :key="index" :style="{'flex':'0 0 '+ getItemValue() + '%'}" @click="jumpLink(item.linkObj)">
        <!--<router-link class="item" :to="jumpLink(item.linkObj)">-->
          <div class="img-box">
            <div class="img-box-inner">
              <el-image
                :src="item.img"
                fit="cover"></el-image>
            </div>
          </div>
          <h4 class="h4">{{item.title}}</h4>
        <!--</router-link>-->
      </li>
    </ul>
  </template>
  
  <script>
    import {funMixin} from '../config/mixin'
    export default {
      name: 'imageTextNav',
      mixins: [funMixin],
      props: {
        terminal: {
          type: Number,
          default: 4
        },
        componentContent: {
          type: Object
        }
      },
      methods: {
        // 计算生成格子百分比
        getItemValue (val) {
          const len = parseInt(this.componentContent.imgTextData.length)
          if (len === 0) {
            return 0
          } else {
            return (1 / len * 10000 / 100.00)
          }
        }
      }
    }
  </script>
  
  <style lang="scss" scoped>
    .image-text-nav{
      min-height: 100px;
      width: 690px;
      margin: 0 auto;
      display: flex;
      padding: 20px 0;
      .li{
        text-align: center;
        cursor: pointer;
        .img-box{
          .el-image{
            width: 100px;
            height: 100px;
          }
        }
        .h4{
          font-size: 26px;
          color: #333;
          line-height: 33px;
        }
      }
      &.terminal4{
        width: 1000px;
        .li{
          .img-box{
            display: inline-block;
            width: 100px;
            height: 100px;
            border: 2px solid #F3F4F5;
            border-radius: 10px;
            &-inner{
              display: flex;
              justify-content: center;
              align-items: center;
              height: 100%;
            }
            .el-image{
              width: 60px;
              height: 60px;
            }
          }
          .h4{
            font-size: 18px;
            color: #ccc;
            line-height: 1em;
            padding-top: 20px;
          }
        }
      }
    }
  </style>