Using the swiper plug-in in the vux component, the effect of the banner image is realized. It is also required that by clicking on the image of the banner image, you can jump to the details page, where the data of the banner image is transmitted from the backend.
The data transmitted from the backend is shown in the figure:
the parameter id in the data needs to be transmitted, so that the details page can get
the click event that I originally wanted to bind to the swiper. After binding, the click does not respond. I don’t know the specific reason. Why
Solution:
This is to connect to the back-end interface to obtain data. The original code
is modified. There is only one more line of code. Just
add url to the data transmitted from the back-end. The url can write the id of the current picture, use url Pass the parameter id out, without clicking the event, you can also jump with the parameter id after clicking
After adding the url, you can see that the background data has become like this
. The data transmitted from the backend can be modified and added.