diff --git a/playground/core/index.html b/playground/core/index.html index 80fe5600d..9706f8210 100644 --- a/playground/core/index.html +++ b/playground/core/index.html @@ -1,49 +1,48 @@ + + + Swiper Playground + + + - - - Swiper Playground - - - + +
+
Slide 1
+
Slide 2
+
Slide 3
+
Slide 4
+
Slide 5
+
Slide 6
+
Slide 7
+
Slide 8
+
Slide 9
+
Slide 10
+
+ Append + - - + .swiper-container { + width: 100%; + height: 300px; + margin: 50px auto; + } + .swiper-slide { + background: #f1f1f1; + color: #000; + text-align: center; + line-height: 300px; + } + + + diff --git a/playground/core/main.js b/playground/core/main.js index 598f0abe7..dd7ad5ff8 100644 --- a/playground/core/main.js +++ b/playground/core/main.js @@ -19,3 +19,10 @@ window.swiper = new Swiper({ itemRoleDescriptionMessage: 'slide', }, }); + +// eslint-disable-next-line no-restricted-globals +document.querySelector('.append-slide').addEventListener('click', (e) => { + e.preventDefault(); + // eslint-disable-next-line no-restricted-globals + window.swiper.appendSlide('
Slide
'); +}); diff --git a/src/components/pagination/pagination.less b/src/components/pagination/pagination.less index b84ca5528..c12e627b9 100644 --- a/src/components/pagination/pagination.less +++ b/src/components/pagination/pagination.less @@ -77,6 +77,10 @@ .swiper-pagination-clickable & { cursor: pointer; } + + &:only-child { + display: none !important; + } } .swiper-pagination-bullet-active { opacity: 1; diff --git a/src/components/pagination/pagination.scss b/src/components/pagination/pagination.scss index 7e600816d..4a977d81f 100644 --- a/src/components/pagination/pagination.scss +++ b/src/components/pagination/pagination.scss @@ -67,6 +67,10 @@ .swiper-pagination-clickable & { cursor: pointer; } + + &:only-child { + display: none !important; + } } .swiper-pagination-bullet-active { opacity: 1;