@tarojs/components-react 3.4.11 → 3.4.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10314,16 +10314,18 @@ var Swiper = /*#__PURE__*/function (_React$Component2) {
10314
10314
  var _this$props2 = this.props,
10315
10315
  _this$props2$autoplay = _this$props2.autoplay,
10316
10316
  autoplay = _this$props2$autoplay === void 0 ? false : _this$props2$autoplay,
10317
- _this$props2$interval = _this$props2.interval,
10318
- interval = _this$props2$interval === void 0 ? 5000 : _this$props2$interval,
10319
- _this$props2$duration = _this$props2.duration,
10320
- duration = _this$props2$duration === void 0 ? 500 : _this$props2$duration,
10317
+ _this$props2$circular = _this$props2.circular,
10318
+ circular = _this$props2$circular === void 0 ? true : _this$props2$circular,
10321
10319
  _this$props2$current = _this$props2.current,
10322
10320
  current = _this$props2$current === void 0 ? 0 : _this$props2$current,
10323
10321
  _this$props2$displayM = _this$props2.displayMultipleItems,
10324
10322
  displayMultipleItems = _this$props2$displayM === void 0 ? 1 : _this$props2$displayM,
10325
- vertical = _this$props2.vertical,
10326
- spaceBetween = _this$props2.spaceBetween; // eslint-disable-next-line @typescript-eslint/no-this-alias
10323
+ _this$props2$duration = _this$props2.duration,
10324
+ duration = _this$props2$duration === void 0 ? 500 : _this$props2$duration,
10325
+ _this$props2$interval = _this$props2.interval,
10326
+ interval = _this$props2$interval === void 0 ? 5000 : _this$props2$interval,
10327
+ spaceBetween = _this$props2.spaceBetween,
10328
+ vertical = _this$props2.vertical; // eslint-disable-next-line @typescript-eslint/no-this-alias
10327
10329
 
10328
10330
  var that = this;
10329
10331
  var opt = {
@@ -10332,7 +10334,7 @@ var Swiper = /*#__PURE__*/function (_React$Component2) {
10332
10334
  el: ".taro-swiper-".concat(this._id, " > .swiper-container > .swiper-pagination")
10333
10335
  },
10334
10336
  direction: vertical ? 'vertical' : 'horizontal',
10335
- loop: true,
10337
+ loop: circular,
10336
10338
  slidesPerView: parseFloat(String(displayMultipleItems)),
10337
10339
  initialSlide: parseInt(String(current), 10),
10338
10340
  speed: parseInt(String(duration), 10),
@@ -10380,7 +10382,12 @@ var Swiper = /*#__PURE__*/function (_React$Component2) {
10380
10382
 
10381
10383
  if (className.includes('taro_page') && target.style.display !== 'none') {
10382
10384
  if (that.props.autoplay && target.contains(_swiper.$el[0])) {
10383
- _swiper.slideTo(that._$current);
10385
+ if (that.props.circular) {
10386
+ _swiper.slideToLoop(this.realIndex, 0); // 更新下标
10387
+
10388
+ } else {
10389
+ _swiper.slideTo(this.realIndex);
10390
+ }
10384
10391
  }
10385
10392
  }
10386
10393
  }