<template>
<div class="wrapper">
<swiper :options="swiperOption">
<swiper-slide v-for="item of swiperList" :key="item.id">
<img class="swiper-img" :src="item.imgUrl">
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</div>
</template>
<script>
// import swiper from "vue-awesome-swiper";
export default {
name: 'HomeSwiper',
data () {
return {
swiperOption: {
pagination: '.swiper-pagination',
loop: true
},
swiperList: [
{
id: '0001',
imgUrl: 'http://img1.qunarzz.com/piao/fusion/1802/e3/62ce7362ca051d02.jpg_640x200_6db551b7.jpg'
},
{
id: '0002',
imgUrl: 'http://img1.qunarzz.com/piao/fusion/1801/93/ce59d182aca07102.jpg_640x200_ba03d44c.jpg'
}
]
}
}
}
老师你好
:src="item.imgUrl"这里为什么要用:src,不是很理解
另外 这里的options是什么我也不是很理解
课程紧跟Vue3版本迭代,企业主流版本Vue2+Vue3全掌握
了解课程