更新记录
1.0.0(2025-09-11)
下载此版本
1.0.0
平台兼容性
uni-app(4.07)
Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
快应用-华为 |
快应用-联盟 |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
其他
yo-indicator-dot
一个美观的uniapp轮播指示器组件,支持自定义颜色和平滑过渡动画。
特性
- ✨ 支持Vue2和Vue3
- 🎨 自定义指示点颜色
- 📏 可调整指示点尺寸和间距
- ⚡️ 平滑的过渡动画
- 📱 支持所有uniapp平台
- 🚀 轻量级,无依赖
安装
方式一:插件市场安装
- 访问 DCloud插件市场
- 搜索
yo-indicator-dot
- 点击安装到项目
方式二:手动安装
- 下载插件包
- 解压到项目的
uni_modules
目录下
使用方法
基础用法
<template>
<view>
<!-- 轮播组件 -->
<swiper @change="onSwiperChange">
<swiper-item v-for="(item, index) in bannerList" :key="index">
<image :src="item.image"></image>
</swiper-item>
</swiper>
<!-- 指示器组件 -->
<yo-indicator-dot
:current-index="currentIndex"
:length="bannerList.length"
/>
</view>
</template>
<script setup>
import { ref } from 'vue'
const currentIndex = ref(0)
const bannerList = ref([
{ image: '/static/banner1.jpg' },
{ image: '/static/banner2.jpg' },
{ image: '/static/banner3.jpg' }
])
const onSwiperChange = (e) => {
currentIndex.value = e.detail.current
}
</script>
自定义样式
<template>
<yo-indicator-dot
:current-index="currentIndex"
:length="bannerList.length"
default-color="#e5e5e5"
active-color="#ff6b35"
default-width="10rpx"
active-width="24rpx"
dot-height="10rpx"
gap="16rpx"
duration="0.5s"
/>
</template>
API
Props
参数 |
类型 |
默认值 |
说明 |
current-index |
Number |
0 |
当前轮播的下标 |
length |
Number |
0 |
轮播数据的长度 |
default-color |
String |
#cccccc |
默认指示点的颜色 |
active-color |
String |
#007aff |
选中指示点的颜色 |
default-width |
String |
12rpx |
默认指示点宽度 |
active-width |
String |
20rpx |
选中指示点宽度 |
dot-height |
String |
12rpx |
指示点高度 |
gap |
String |
12rpx |
指示点间距 |
duration |
String |
0.3s |
动画持续时间 |
平台兼容性
Vue2 |
Vue3 |
App |
H5 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
***小程序 |
钉钉小程序 |
京东小程序 |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
✅ |
更新日志
查看 CHANGELOG.md
License
MIT