joe223 / tiny-swiper

Ingenious JavaScript Carousel powered by wonderful plugins. Lightweight yet extensible. Import plugins as needed, No more, no less.
https://tiny-swiper.js.org
1.29k stars 58 forks source link

Implementation of the `slidesPerGroup` option #59

Open shossk opened 3 years ago

shossk commented 3 years ago

Is your feature request related to a problem? Please describe. Hello, joe. I found this library because I was tired of Swiper's complex and large number of dependencies. It is exactly the best library I could have asked for. However, I noticed that there is one option missing. It is slidesPerGroup. I will be very happy to stop using Swiper, which I hate to do. Have you considered implementing this? If not, can you consider it as a pull request?

Describe the solution you'd like Implementation of the slidesPerGroup option

Describe alternatives you've considered We know that if we implement this, we will get closer and closer to Swiper. I would like to see this implemented, even as a plugin.

thanks!

joe223 commented 3 years ago

@shossk Really appreciate.

Implementation of the slidesPerGroup option

That is what I'm concerned with.

The better solution is provide a group of APIs that give us the ability to modify render/translate effect. We can implement slidesPerGroup with such APIs in an external plugin. But I have not figure out what this APIs should be yet.

Here is what I'm doing(the API is kinda of babbling)

https://github.com/joe223/tiny-swiper/blob/173c053da3acfb6677d06de3efaa28d1274bb6cf/packages/tiny-swiper/src/core/render/index.ts#L68

How do you think?

shossk commented 3 years ago

@joe223 That's good! Thanks for taking the time to do this!

joe223 commented 3 years ago

@shossk Just creat a PR if you got other idea😃

kmergen commented 3 years ago

I think that should be a native option. We have the option "slidesPerView" then an option "slidesPerSlide" would make sense