Sfoglia il codice sorgente

chore: update judge in autoPlay

林艳 1 anno fa
parent
commit
e6c5c03bb2
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      packages/semi-foundation/carousel/foundation.ts

+ 1 - 1
packages/semi-foundation/carousel/foundation.ts

@@ -128,7 +128,7 @@ class CarouselFoundation<P = Record<string, any>, S = Record<string, any>> exten
         const autoPlayType = typeof autoPlay;
         // when user manually call the play function, force play
         // only when carousel children length > 1 to start play
-        if (children.length > 1 && ((autoPlayType === 'boolean' && autoPlay) || isObject(autoPlay) || this._forcePlay)) {
+        if (children.length > 1 && ((autoPlay === true) || isObject(autoPlay) || this._forcePlay)) {
             this.play(this.getSwitchingTime());
         }
     }