describe
I haven’t written a small program for a long time. Today I encountered a problem. How does the swiper of the small program realize the spacing carousel?
Similar to the following effect, the yellow part is the content and the gray is the spacing
I set a margin for each swiper-item and found that it didn’t work. I went to the documentation to read the attributes of the swiper and
tried this too. Maybe my calculations were wrong, and it didn’t work at all!
However, I thought of a way that is easier to implement but easily overlooked!
solve
I have been thinking about the question for a long time, but I am just a little bit less spiritual!
The answer is, wrap another layer of view to reduce the width!
I'm such a genius!