From 27e75c915fb9c218647934e7c4af93734034109c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=A6=B902?= <1940806266@qq.com> Date: Sat, 2 Apr 2022 04:46:21 +0000 Subject: [PATCH] =?UTF-8?q?update=20docs/component/uniui/uni-swiper-dot.md?= =?UTF-8?q?.=20api=20SwiperDot=20Props.=20=E5=BA=94=E8=AF=A5=E6=98=AF?= =?UTF-8?q?=E9=82=A3=E9=87=8C=E6=88=91=E7=8C=9C=E6=83=B3=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=98=AF=E4=BD=9C=E8=80=85=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=90=A7=E3=80=82=20=20=E5=BA=94=E8=AF=A5=E6=98=AF=E6=83=B3?= =?UTF-8?q?=E8=A1=A8=E8=BE=BESwiperDot=20Props=E3=80=82=20=20=20=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AFSwiperDod=20Props?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/component/uniui/uni-swiper-dot.md | 198 ++++++++++++------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/docs/component/uniui/uni-swiper-dot.md b/docs/component/uniui/uni-swiper-dot.md index c8bf0508b..c7c9defc1 100644 --- a/docs/component/uniui/uni-swiper-dot.md +++ b/docs/component/uniui/uni-swiper-dot.md @@ -1,93 +1,93 @@ - -::: tip 组件名:uni-swiper-dot -> 代码块: `uSwiperDot` - -[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot) -::: - -自定义轮播图指示点 - -## 介绍 -::: warning 注意事项 -> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 -- 本组件依赖 `swiper` 组件,请与`swiper`组件配合使用 -- `width` 与 `height` 如非必要,请勿设置过大,或者过小 -- `swiper-item` 尽量控制在一定数量之内,否则指示点可能会超出屏幕 -- 暂不支持垂直方向的指示点 -::: -### 基本用法 - -在 ``template`` 中的使用 - -```html - - - - - {{item.content}} - - - - -``` - -```javascript -export default { - data() { - return { - info: [{ - content: '内容 A' - }, { - content: '内容 B' - }, { - content: '内容 C' - }], - current: 0, - mode: 'round', - } - }, - methods: { - change(e) { - this.current = e.detail.current; - } - } -} -``` - -## API - -### SwiperDod Props - -|属性名|类型|默认值|说明| -|:-:|:-:|:-:|:-:| -|current|Number |0|当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`| -|mode|String|default|指示点的类型,可选值:default 、round 、nav 、 indexes| -|field|String|-| mode 为 nav 时,显示的内容字段(mode = nav 时必填)| -|info|Array |-|轮播图的数据,通过数组长度决定指示点个数| -|dotsStyles |Object |-|指示点样式| - -#### dotsStyles Options - -|属性名|类型 |默认值|说明| -|:-:|:-:|:-:|:-:| -|width|Number| 8|指示点宽度 **在 mode = nav、mode = indexes 时不生效**| -|bottom|Number | 10|指示点距 `swiper` 底部的高度| -|color|Color | '#fff'|指示点前景色,**只在 mode = nav ,mode = indexes 时生效** | -|backgroundColor|Color | 'rgba(0, 0, 0, .3)'|未选择指示点背景色| -|border|Border | '1px rgba(0, 0, 0, .3) solid' |未选择指示点边框样式| -|selectedBackgroundColor|Color | '#333'|已选择指示点背景色,**在 mode = nav 时不生效**| -|selectedBorder|Border | '1px rgba(0, 0, 0, .9) solid' |已选择指示点边框样式,**在 mode = nav 时不生效**| - -## 示例 -::: warning 注意 -示例依赖了 `uni-card` `uni-section` `uni-scss` 等多个组件,直接拷贝示例代码将无法正常运行 。 - -请到 [组件下载页面](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot) ,在页面右侧选择 `使用 HBuilderX导入示例项目` ,体验完整组件示例。 -::: - -::: preview https://hellouniapp.dcloud.net.cn/pages/extUI/swiper-dot/swiper-dot -> Template -``` html + +::: tip 组件名:uni-swiper-dot +> 代码块: `uSwiperDot` + +[点击下载&安装](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot) +::: + +自定义轮播图指示点 + +## 介绍 +::: warning 注意事项 +> 为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。 +- 本组件依赖 `swiper` 组件,请与`swiper`组件配合使用 +- `width` 与 `height` 如非必要,请勿设置过大,或者过小 +- `swiper-item` 尽量控制在一定数量之内,否则指示点可能会超出屏幕 +- 暂不支持垂直方向的指示点 +::: +### 基本用法 + +在 ``template`` 中的使用 + +```html + + + + + {{item.content}} + + + + +``` + +```javascript +export default { + data() { + return { + info: [{ + content: '内容 A' + }, { + content: '内容 B' + }, { + content: '内容 C' + }], + current: 0, + mode: 'round', + } + }, + methods: { + change(e) { + this.current = e.detail.current; + } + } +} +``` + +## API + +### SwiperDot Props + +|属性名|类型|默认值|说明| +|:-:|:-:|:-:|:-:| +|current|Number |0|当前指示点索引,必须是通过 `swiper` 的 `change` 事件获取到的 `e.detail.current`| +|mode|String|default|指示点的类型,可选值:default 、round 、nav 、 indexes| +|field|String|-| mode 为 nav 时,显示的内容字段(mode = nav 时必填)| +|info|Array |-|轮播图的数据,通过数组长度决定指示点个数| +|dotsStyles |Object |-|指示点样式| + +#### dotsStyles Options + +|属性名|类型 |默认值|说明| +|:-:|:-:|:-:|:-:| +|width|Number| 8|指示点宽度 **在 mode = nav、mode = indexes 时不生效**| +|bottom|Number | 10|指示点距 `swiper` 底部的高度| +|color|Color | '#fff'|指示点前景色,**只在 mode = nav ,mode = indexes 时生效** | +|backgroundColor|Color | 'rgba(0, 0, 0, .3)'|未选择指示点背景色| +|border|Border | '1px rgba(0, 0, 0, .3) solid' |未选择指示点边框样式| +|selectedBackgroundColor|Color | '#333'|已选择指示点背景色,**在 mode = nav 时不生效**| +|selectedBorder|Border | '1px rgba(0, 0, 0, .9) solid' |已选择指示点边框样式,**在 mode = nav 时不生效**| + +## 示例 +::: warning 注意 +示例依赖了 `uni-card` `uni-section` `uni-scss` 等多个组件,直接拷贝示例代码将无法正常运行 。 + +请到 [组件下载页面](https://ext.dcloud.net.cn/plugin?name=uni-swiper-dot) ,在页面右侧选择 `使用 HBuilderX导入示例项目` ,体验完整组件示例。 +::: + +::: preview https://hellouniapp.dcloud.net.cn/pages/extUI/swiper-dot/swiper-dot +> Template +``` html -``` -> Script +``` +> Script ```html -``` -> Style +``` +> Style ```html - -``` -::: - + + +``` +::: + [完整示例演示](https://hellouniapp.dcloud.net.cn/pages/extUI/swiper-dot/swiper-dot) \ No newline at end of file -- GitLab