这种效果的:
<el-carousel indicator-position="outside">
<el-carousel-item v-for="item in detailList.fileList" :key="item">
<img :src="item.fileUrl" />
</el-carousel-item>
</el-carousel>
// 将轮播图指示器渲染成图片
indicatorToimage() {
const a = document.querySelectorAll('.el-carousel__button')
for (let b = 0; b < (this.detailList.fileList.length );) {
if (b < this.detailList.fileList.length) {
for (const i in this.detailList.fileList) {
const img = document.createElement('img')
img.src = this.detailList.fileList[i].fileUrl
a[b].appendChild(img)
b++
}
} else {
}
}
},```
样式
/deep/ .el-carousel__indicators--outside {
overflow: auto;
.el-carousel__indicator--horizontal {
display: table-cell;
}
}
/* 轮播图样式 */
.el-carousel {
width: 543px;
img {
width: 100%;
height: 100%;
}
}
/deep/ .el-carousel__container {
height: 478px;
}
/deep/.el-carousel__button {
width: 100px;
height: 100px;
img {
width: 100%;
height: 100%;
}
}