1. 程式人生 > >VUE背景圖片路徑拼接

VUE背景圖片路徑拼接

 <a class="new_onLine_one" v-for="(brand,index) in imgList " :key="index">
     <div class="fl rank_img" v-bind:style="{ 'background-image': 'url(' + brand.src+ ')' }">
     </div>
</a>
<script>
export default {
    name: "Carousel",
    data() {
     return{
         imgList : [
            {id: 1, src:'https://placehold.it/190x180'},
            {id: 2, src:'https://placehold.it/180x190'},
          ]
     }
    },
};
</script>