# tui-swiper-dot swiper指示点

介绍

swiper指示点,提供了常用的显示类型

# 引入

# uni-app引入

第一种,手动引入(可全局引入)

import tuiSwiperDot from "@/components/thorui/tui-swiper-dot/tui-swiper-dot.vue"
export default {
	components:{
		tuiSwiperDot
	}
}

第二种,开启easycom组件模式,如果不了解如何配置,可先查看 官网文档 (opens new window)

# uni-app版本平台差异说明

App-Nvue App-vue H5 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
升级中

# 微信小程序引入(可在app.json中全局引入)

{
  "usingComponents": {
    "tui-swiper-dot": "/components/thorui/tui-swiper-dot/tui-swiper-dot"
  }
}

# 代码演示

部分功能演示,具体可参考示例程序以及文档API。

显示类型

通过 type 属性设置指示点的显示类型,默认值为1。

显示类型:1-dot, 2-index, 3-title, 4-右侧停靠index

<!--uni-app-->
<tui-swiper-dot :type="2"></tui-swiper-dot>

<!--微信小程序-->
<tui-swiper-dot type="{{2}}"></tui-swiper-dot>

# Slots

none

# Props

参数 类型 说明 默认值
type Number 显示类型:1-dot, 2-index, 3-title, 4-右侧停靠index 1
count Number 总数,数组总长度 0
current Number 当前swiper-item索引 0
currentTitle String 当前swiper-item标题 -
left String left值 0
right String right值 auto
bottom String bottom值 30rpx
width String 指示点[type in (1,2)]或外层盒子[type in (3,4)]宽度 16rpx
height String 指示点[type in (1,2)]或外层盒子[type in (3,4)]高度 16rpx
radius String 指示点圆角 50%
backgroundColor String 背景色 #bfbfbf
activeBgColor String 当前展示item背景色 #5677fc
color String 字体颜色 #333
activeColor String 当前展示item字体颜色,type=2时生效 #fff
size Number 字体大小,单位rpx 28
margin String 指示点margin值 0 8rpx
padding String padding值,type=3时生效 0 30rpx

# Events

none

# 预览

请以移动端效果为准,touch事件目前尚未在PC端做兼容。

# 线上程序扫码预览

ThorUI组件库 H5二维码 ThorUI示例
ThorUI组件库小程序码 H5二维码 ThorUI示例小程序码