轮播图几种方法
<div id="container"> </div> 样式 #container{ width:1000px; height:300px; overflow:hide; } #photo{ width:3000px; height:300px; animation: switch 5s ease-out infinite } img{ float:left; width:100%; height:300px; } @keyframes switch{ 0%,25%{ margin-left:0px; } 40%,65%{ margin-left:-1000px; } 75%,100%{ margin-left:-2000px; } } 引入 import { Swipe, SwipeItem } from 'vant'; Vue.use(Swipe).use(SwipeItem); < van-swipe :autoplay= "3000" indicator-color= "white"> van-swipe-item>1 </ van-swipe-item> van-swipe-item>2 </ van-swipe-item> van-swipe-item>3 </ van-swipe-item> van-swipe-item>4 </ van-swipe-item> </