vue element-ui 走马灯轮播图

本地图片地址加上 require(“@/assets/imgs/**.jpg”)
src 下目录地址
vue element-ui 走马灯轮播图_第1张图片

<template>
   <div>
       <div style="margin: 10px 0">
         <el-carousel height="450px">
           <el-carousel-item v-for="item in imgList" :key="item.id">
             <img :src="item.idView" class="" style="width: 100%">
           el-carousel-item>


         el-carousel>
       div>
   div>
template>

<script>
export default {
  name: "FrontHome",
  data(){
    return{
      imgList: [
        {id:1,idView:require("@/assets/imgs/123.jpg")},
        {id:2,idView:require("@/assets/imgs/555.jpg")},
        {id:3,idView:require("@/assets/imgs/666.jpg")}
      ]
    }
  }
}
script>

<style scoped>

style>

你可能感兴趣的:(vue,笔记,vue,elementui)