| | |
| | | |
| | | <img src="https://tdesign.gtimg.com/miniprogram/readme/swiper.gif" width="375px" height="50%"> |
| | | |
| | | |
| | | <a href="https://developers.weixin.qq.com/s/nx7fJiml7QSM" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a> |
| | | |
| | | <blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" > |
| | | <p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p> |
| | | </blockquote> |
| | | |
| | | ### 组件类型 |
| | | |
| | | #### 点状(dots)轮播图 |
| | |
| | | click | `(index: number)` | `0.34.0`。点击轮播项时触发 |
| | | image-load | `(index: number)` | `1.1.4`。图片加载时触发 |
| | | |
| | | ### Swiper 外部样式类 |
| | | |
| | | 类名 | 说明 |
| | | -- | -- |
| | | t-class | 根节点样式类 |
| | | t-class-nav | 导航样式类 |
| | | t-class-image | 当前图片样式类 |
| | | t-class-prev-image | 上一图片样式类 |
| | | t-class-next-image | 下一图片样式类 |
| | | |
| | | ### SwiperNav Props |
| | | |
| | | 名称 | 类型 | 默认值 | 说明 | 必传 |
| | |
| | | show-controls | Boolean | false | `0.32.0`。是否显示两侧的控制按钮 | N |
| | | total | Number | 0 | `0.34.0`。总共的项数 | N |
| | | type | String | dots | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/swiper-nav/type.ts) | N |
| | | |
| | | ### SwiperNav 外部样式类 |
| | | |
| | | 类名 | 说明 |
| | | -- | -- |
| | | t-class | 根节点样式类 |
| | | |
| | | ### CSS 变量 |
| | | 组件提供了下列 CSS 变量,可用于自定义样式。 |
| | | 名称 | 默认值 | 描述 |
| | | -- | -- | -- |
| | | --td-swiper-item-padding | 0 | - |
| | | --td-swiper-radius | @radius-large | - |
| | | --td-swiper-nav-btn-bg-color | @font-gray-3 | - |
| | | --td-swiper-nav-btn-color | @font-white-1 | - |
| | | --td-swiper-nav-btn-size | 48rpx | - |
| | | --td-swiper-nav-dot-active-color | @font-white-1 | - |
| | | --td-swiper-nav-dot-color | @font-white-2 | - |
| | | --td-swiper-nav-dot-size | 12rpx | - |
| | | --td-swiper-nav-dots-bar-active-width | 40rpx | - |
| | | --td-swiper-nav-fraction-bg-color | @font-gray-3 | - |
| | | --td-swiper-nav-fraction-color | @font-white-1 | - |
| | | --td-swiper-nav-fraction-font-size | 24rpx | - |
| | | --td-swiper-nav-fraction-height | 48rpx | - |