参考链接 :https://blog.csdn.net/qq_34664239/article/details/79106570

元素 

<template>
<el-carousel trigger="click" height="386px" :autoplay=false arrow="never">
                <el-carousel-item v-for="(item,index) in options" :key="index" :style="{backgroundImage:'url(' + item.img + ')', backgroundRepeat:'no-repeat', backgroundPosition:'center top', backgroundSize: 'cover'}">
                   <div class="info">
                         <h2>{{item.info}}</h2>
                   </div>
                </el-carousel-item>
            </el-carousel>
</template>

数据

<script>
export default {
    data(){
        return {
            options:[{
                // 图片的引入方式
                img:require('../assets/images/banner.jpg'),
                info:'Access Institutional tools direct from MT4 when you go live'
            },{
                img:require('../assets/images/banner.jpg'),
                info:'Access Institutional tools direct from MT4 when you go live'
            },{
                img:require('../assets/images/banner.jpg'),
                info:'Access Institutional tools direct from MT4 when you go live'
            },{
                img:require('../assets/images/banner.jpg'),
                info:'Access Institutional tools direct from MT4 when you go live'
            }]
        }
    }
}
</script>

 

Logo

前往低代码交流专区

更多推荐