<div class="carousel">
        <el-carousel indicator-position="outside" @change="changeCarousel">
          <el-carousel-item v-for="(item, index) in images" :key="index">
            <img class="carousel-img" :src="item.src" />
          </el-carousel-item>
        </el-carousel>
        <div class="carousel-text">
          <label>{{ this.labelCh }}</label>
          <label>{{ this.labelEn }}</label>
        </div>
      </div>
    // 幻灯片轮播时赋值text
    changeCarousel(active, val) {

      //active为进入幻灯片的索引值
      //val 为离开幻灯片的索引值
      console.log("active", active);
      console.log("val", val);
      this.labelCh = this.texts[active].labelCh;
      this.labelEn = this.texts[active].labelEn;
    },
Logo

前往低代码交流专区

更多推荐