非常簡單好用實(shí)用的輪播圖swiper banner組件; 下載完整代碼請?jiān)L問uni-app插件市場地址:https://ext.dcloud.net.cn/plugin?id=12786
效果圖如下:

實(shí)現(xiàn)代碼如下:
# 非常簡單好用實(shí)用的輪播圖swiper banner組件,一行代碼即可實(shí)現(xiàn)輪播圖
#### 使用方法
```使用方法
<!-- interval:輪播間隔時(shí)間? imgList: 輪播圖數(shù)組? @click:輪播圖點(diǎn)擊事件-->
<ccCarouseView interval="2000" :imgList="myImgList" @click="goImgClick"></ccCarouseView>
```
#### HTML代碼部分
```html
<template>
<view class="content">
<view class="text-area">
<text class="title">{{title}}</text>
</view>
<!-- interval:輪播間隔時(shí)間? imgList: 輪播圖數(shù)組? @click:輪播圖點(diǎn)擊事件-->
<ccCarouseView interval="2000" :imgList="myImgList" @click="goImgClick"></ccCarouseView>
</view>
</template>
```
#### JS代碼 (引入組件 填充數(shù)據(jù))
```javascript
<script>
import ccCarouseView from '../../components/ccCarouseView.vue'
export default {
components: {
ccCarouseView
},
data() {
return {
title: '使用方法: <ccCarouseView interval="2000" :imgList="myImgList" @click="goImgClick"></ccCarouseView>',
myImgList: []
}
},
onLoad() {
// 模擬數(shù)據(jù)
this.myImgList = [{
'name': '圖片1',
'imgUrl': 'https://cdn.pixabay.com/photo/2016/08/15/14/33/rock-towers-1595571_1280.jpg'
},
{
'name': '圖片2',
'imgUrl': 'https://cdn.pixabay.com/photo/2023/05/07/12/14/beetle-7976249_1280.jpg',
},
{
'name': '圖片3',
'imgUrl': 'https://cdn.pixabay.com/photo/2019/12/19/16/48/canton-4706569_1280.jpg',
},
{
'name': '圖片4',
'imgUrl': 'https://cdn.pixabay.com/photo/2022/04/27/12/30/switzerland-7160290_1280.jpg'
}
]
},
methods: {
goImgClick(item){
? uni.showModal({
? title:'溫馨提示',
content: '點(diǎn)擊圖片帶的數(shù)據(jù)= ' + JSON.stringify(item)
? })
}
}
}
</script>
```
#### CSS
```CSS
<style>
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.text-area {
display: flex;
justify-content: center;
margin: 20px 0px;
width: calc(100vw - 40px);
}
.title {
font-size: 32rpx;
color: #161616;
}
</style>
```