使用vue.js怎麼寫出輪播圖?

使用vue.js怎麼寫出輪播圖


說到輪播,那你一定知道鼎鼎大名的swiper,其實用vue來封裝swiper是很輕鬆的事情,我實現了一個。具體教程前往:react轉vue--vue2封裝swiper輪播組件(2) - react架構經驗分享 - SegmentFault

&
&
&
&& & && & &

&
import Swiper from "swiper";
import "swiper/dist/css/swiper.min.css";
export default {
props: ["listImg"],
mounted() {
console.log("mounted", this)
var swiper = new Swiper(".swiper-container", {
pagination: ".swiper-pagination",
paginationClickable: true,
loop: true,
speed: 600,
autoplay: 4000,
onTouchEnd: function() {
swiper.startAutoplay()
}
});
}
}
&

&