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
Suddenly when I logged into MySQL, it said that a...
1.docker search mysql查看mysql版本 2. docker pull mys...
Server Information Management server: m01 172.16....
1. Title HTML defines six <h> tags: <h1&...
Before we begin, we create two tables to demonstr...
sshd SSH is the abbreviation of Secure Shell, whi...
In my previous article, I said that the optimizat...
This article is a self-written imitation of the X...
Table of contents What is Express middleware? Req...
Table of contents Congruent and Incongruent congr...
Table of contents 1. Stored Procedure 1.1. Basic ...
Table of contents Effect demonstration:Main JS co...
I have encountered many centering problems recent...
Table of contents Preface 1. Key Elements of a Re...
Installation Steps 1. Create a virtual machine 2....