title: Swiper slider. slideTo method with loop
body: <p>I need some help with <a href="https://swiperjs.com/api/#methods" rel="nofollow noreferrer">Swiper slider</a>.</p>
  
  <p>Can`t set slider to initial position on resize. Method "swiper.slideTo(0)" don`t work.<br>
  Maybe anyone know how solve this problem. A very important thing, loop must be active when the slider is "active".<br>
  Or how to set loop param to breakpoints)).<br>
  I use vanilla Swiper on Vue project.</p>
  
  <p><code>switchInitSwiper</code> - wrapper for full reInit on resize;<br>
  <code>checker</code> - only enable/disable some properties</p>
  
  <pre><code>let self = this;
  this.$refs.viewedSlider._SLIDES_COUNT_ = this.$refs.viewedSlider.querySelectorAll('.shop-item');
  let viewed = switchInitSwiper({query: '(max-width:0px)', element: this.$refs.viewedSlider, thinArrow: true}, {
      spaceBetween: 0,
      slidesPerView: 4,
      loop: true,
      navigation: {
          nextEl: '.swiper-button-next.viewed',
          prevEl: '.swiper-button-prev.viewed',
      },
      breakpoints,
      on
  });
  
  let on = {resize: checker, init: checker};
  let breakpoints = {
      0: {slidesPerView: 1},
      600: {slidesPerView: 2},
      800: {slidesPerView: 3},
      1100: {slidesPerView: 4}
  };
  
  
  
  function checker() {
      let slider = null;
      let currentPerView = this.passedParams.breakpoints[this.currentBreakpoint].slidesPerView;
  
      if (this.el === self.$refs.viewedSlider) {
          slider = self.$refs.viewedSlider;
      } else if(this.el === self.$refs.similarSlider) {
          slider = self.$refs.similarSlider;
      }
  
      if (currentPerView &gt;= slider._SLIDES_COUNT_.length) {
          this.el.parentElement.classList.add('disable-slider');
          this.allowTouchMove = false;
          this.allowSlideNext = false;
          this.allowSlidePrev = false;
  
          this.slideTo(0, 1000);// &lt;------ this don`t work
          //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
          console.log('O+_O');
      } else {
          this.el.parentElement.classList.remove('disable-slider');
          this.allowTouchMove = true;
          this.allowSlideNext = true;
          this.allowSlidePrev = true;
      }
      console.log(this);
  }
  </code></pre>