之前用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,
});
});
}