The vue part is as follows: <template> <view class=""> <!-- Slideshow component--> <swiper :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000" circular=""> <block v-for="(item,index) in swipers" :key="index"> <swiper-item> <view class="swiper-item" @tap="event(index)"> <image :src="item.src" lazy-loading style="height: 350upx;"></image> </view> </swiper-item> </block> </swiper> </view> </template> The nvue part is as follows: <template> <div> <!-- Slideshow component--> <slider :auto-play="true" :interval="3000" class="slider"> <div style="position: relatice;" v-for="(item,index) in swipers" :key="index" @click="event(index)"> <image class="image" resize="cover" :src="item.src"></image> </div> <indicator class="indicator"></indicator> </slider> </div> </template> The CSS style of the nvue part is as follows: <style> .slider,.image{ width: 750px; height: 350px; } .indicator{ position: absolute; right: 0; bottom: 0; width: 150px; height: 30px; background-color: rgba(0,0,0,0); item-color:rgba(255,255,255,0.5); item-selected-color: #FFFFFF; } </style> The js part is as follows:
<script> export default { data() { return { swipers:[{src:"/static/images/demo/demo4.png"}, {src:"/static/images/demo/demo4.png"}, {src:"/static/images/demo/demo4.png"}, {src:"/static/images/demo/demo4.png"}] } }, methods: { event(index){ console.log("Clicked index:"+index) } } } </script> The effect diagram is as follows: vue: nvue: This is the end of this article about uniapp vue and nvue carousel components. For more relevant uniapp carousel component content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Implementation code for taking screenshots using HTML and saving them as local images
>>: Things You Don’t Know About the CSS ::before and ::after Pseudo-Elements
Find the problem I wrote a simple demo before, bu...
This article mainly introduces common strategies ...
It is troublesome to install the db2 database dir...
<br />Preface: Before reading this tutorial,...
Table of contents 1. Implementation 2. Problems 3...
1 Download and start Tomcat Go to the official we...
During the development activity, I encountered a ...
Table of contents 2 solutions for file upload Bas...
Preface This article mainly introduces the analys...
Mapping the mouse position or implementing drag e...
Viewing and Setting SQL Mode in MySQL MySQL can r...
Today's article mainly introduces the reload ...
This article mainly records the problems and solu...
Recently, I received a requirement for function ex...
nginx (engine x) is a high-performance HTTP and r...