xiangpei
2025-05-13 4c4995771ce83925a2d69dedc11c4404d9b77875
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
<template>
  <div class="model-carousel1" :style="{background: bgColor}">
    <div class="nav-body clearfix">
      <!-- 侧边导航 -->
      <div class="nav-side"></div>
      <div class="nav-content">
        <!-- 轮播图 -->
        <Carousel autoplay @on-change="autoChange">
          <CarouselItem v-for="(item, index) in data.options.list" :key="index" >
            <div style="overflow: hidden">
              <img :src="item.img" width="1200" height="470" />
            </div>
          </CarouselItem>
        </Carousel>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  name: 'modelCarousel1',
  props: ['data'],
  data () {
    return {
      showModal: false, // modal显隐
      selected: null, // 已选数据
      picModelFlag: false, // 选择图片modal
      bgColor: '#fff' // 轮播背景色
    };
  },
  mounted () {
    this.bgColor = this.data.options.list[0].bgColor
  },
  methods: {
    // 自动切换时改变背景色
    autoChange (oVal, val) {
      this.bgColor = this.data.options.list[val].bgColor
    }
  }
};
</script>
 
<style scoped lang="scss">
.model-carousel1 {
  width: 100%;
  height: 470px;
  background: #fff;
}
 
/*大的导航信息,包含导航,幻灯片等*/
.nav-body {
  width: 1200px;
  height: 470px;
  margin: 0px auto;
}
.nav-side {
  height: 470px;
  width: 200px;
  padding: 0px;
  color: #fff;
  line-height: 470px;
  text-align: center;
  position: absolute;
  z-index: 1;
}
 
/*导航内容*/
.nav-content {
  width: 1200px;
  height: 470px;
  overflow: hidden;
  float: left;
  position: relative;
}
</style>