This article example shares the specific code of Vue+js clicking the arrow to switch pictures for your reference. The specific content is as follows The front-end requirement is that the returned image data can be switched by clicking the arrow The code is as follows <div class="pubuItemsBox"> <!-- Modifications to the evening of 5.23 --> <template v-for="(orderEvent, index) in orderEventList" > <div :class="{'pubuItem':true, 'noMag':(index+1)%3 == 0}"> <div class="imgDivs"> <template v-if="orderEvent.eventFocuspic.split(',').length > 1"> <ins class="left" @click='change(index,"prev")'></ins> <ins class="right" @click='change(index,"next")'></ins> </template> <ul class="ulZpImg"> <template v-for="(imgUrl,imgUrlIndex) in orderEvent.eventFocuspic.split(',')" > <li v-show='imgUrlIndex===orderEvent.mark'><img :src="getImageUrl(showImg(imgUrl))"></li> </template> </ul> </div> <div class="txtBox"> <span>{{orderEvent.brandName}}</span><ins>Date: {{orderEvent.beginDate}} to {{orderEvent.endDate}}</ins> </div> <p style="-webkit-box-orient: vertical;">{{orderEvent.eventDesc}}</p> </div> </template> </div> <script> change(i, type){ var obj = this.orderEventList[i]; var imgLength =obj.eventFocuspic.split(',').length; if (type === "prev") { if (obj.mark == 0) { obj.mark = imgLength - 1 return } obj.mark--; } if (type === "next") { if (obj.mark == imgLength - 1) { obj.mark = 0 return } console.log(obj.mark) obj.mark++; } } </script> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Modify file permissions (ownership) under Linux
>>: Viewing and analyzing MySQL execution status
virtualenv is a tool for creating isolated Python...
dl:Definition list Definition List dt:Definition t...
Table of contents 1. Scenario description: 2. Cas...
Div solution when relative width and absolute wid...
The use of ElementUI paging component Pagination ...
To use standard CSS3 to achieve the shadow effect...
eureka: 1. Build a JDK image Start the eureka con...
Preface The most common task after we install a L...
The spread operator allows an expression to be ex...
1. The window size opened by the HTML hyperlink C...
Table of contents How to rename MySQL database Th...
Prepare war package 1. Prepare the existing Sprin...
Author | Editor Awen | Produced by Tu Min | CSDN ...
Nginx (engine x) is a high-performance HTTP and r...
What is CN2 line? CN2 stands for China Telecom Ne...