之前用vue框架的時候,還用到了swiper插件,然後就出現了輪播圖不好使的情況,經過我各種找度娘,各種找大神,最後終於解決了
_this.$nextTick(function () {
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
paginationClickable: true,
loop: true,
autoplay : 2000,
speed:700,
});
});
只要把這個代碼複製上去,放到vue裏面就可以,不要問我這個_this是什麼
success:function (data) {
—_this.ban_a = data.info.banner;
_this.time = data.info.activity;
_this.vip = data.info.vip;
_this.$nextTick(function () {
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
paginationClickable: true,
loop: true,
autoplay : 2000,
speed:700,
});
});
}