mounted() { var self = this; for (var i = 0; i < self.$refs.mySwiper.swiper.pagination.bullets.length; i++) { console.log(self.$refs.mySwiper.swiper) console.log(this.$refs.mySwiper.swiper) self.$refs.mySwiper.swiper.pagination.bullets[i].onmouseover = (function(num) { return function () { self.$refs.mySwiper.swiper.slideTo(num + 1); } })(i) } }
切记切记!!!!