Skip to content
Draft
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ image-props | Object | - | `0.34.0` | N
interval | Number | 5000 | \- | N
list | Array | - | `0.32.0`。Typescript:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
loop | Boolean | true | \- | N
navigation | Boolean / Object | true | Typescript:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
navigation | Boolean / Object | true | navigation all config, `true` for using default config。Typescript:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
next-margin | String / Number | 0 | `0.32.0` | N
pagination-position | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right | N
previous-margin | String / Number | 0 | `0.32.0` | N
Expand All @@ -38,7 +38,7 @@ image-load | `(index: number)` | `1.1.4`

name | Description
-- | --
navigation | \-
navigation | navigation all config, `true` for using default config。Typescript:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[see more ts definition](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts)

### Swiper External Classes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ image-props | Object | - | `0.34.0`。透传至 Image 组件 | N
interval | Number | 5000 | 轮播间隔时间 | N
list | Array | - | `0.32.0`。图片列表。TS 类型:`string[] \| SwiperList[]` `interface SwiperList { value: string, ariaLabel: string }`。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
loop | Boolean | true | 是否循环播放 | N
navigation | Boolean / Object | true | 导航器全部配置,true 的话使用默认配置。TS 类型:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
navigation | Boolean / Object | true | 导航器全部配置,`true` 的话使用默认配置。TS 类型:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts) | N
next-margin | String / Number | 0 | `0.32.0`。后边距,可用于露出后一项的一小部分。默认单位 `px` | N
pagination-position | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right | N
previous-margin | String / Number | 0 | `0.32.0`。前边距,可用于露出前一项的一小部分。默认单位 `px` | N
Expand All @@ -38,7 +38,7 @@ image-load | `(index: number)` | `1.1.4`。图片加载时触发

名称 | 描述
-- | --
navigation | 导航器全部配置
navigation | 自定义 `navigation` 显示内容。TS 类型:`SwiperNavProps \| boolean`,[SwiperNav API Documents](./swiper-nav?tab=api)。[详细类型定义](https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/swiper/type.ts)

### Swiper External Classes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const props: TdSwiperProps = {
type: Boolean,
value: true,
},
/** 导航器全部配置,true 的话使用默认配置 */
/** 导航器全部配置,`true` 的话使用默认配置 */
navigation: {
type: null,
value: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface TdSwiperProps {
value?: boolean;
};
/**
* 导航器全部配置,true 的话使用默认配置
* 导航器全部配置,`true` 的话使用默认配置
* @default true
*/
navigation?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import { TdSwiperProps } from './type';
export const swiperDefaultProps: TdSwiperProps = {
animation: 'slide',
autoplay: true,
defaultCurrent: 0,
current: 0,
direction: 'horizontal',
duration: 300,
interval: 5000,
loop: true,
navigation: true,
nextMargin: 0,
previousMargin: 0,
type: 'default',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ style | Object | - | CSS(Cascading Style Sheets),Typescript:`React.CSSProper
animation | String | slide | options: slide | N
autoplay | Boolean | true | \- | N
current | Number | 0 | \- | N
defaultCurrent | Number | 0 | uncontrolled property | N
direction | String | horizontal | options: horizontal/vertical | N
duration | Number | 300 | \- | N
height | String / Number | - | \- | N
interval | Number | 5000 | \- | N
loop | Boolean | true | \- | N
navigation | TNode | - | Typescript:`SwiperNavigation \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
navigation | TNode | true | navigation all config, `true` for using default config。Typescript:`SwiperNavigation \| TNode \| Boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | \- | N
previousMargin | String / Number | 0 | \- | N
type | String | default | options: default/card | N
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ style | Object | - | 样式,TS 类型:`React.CSSProperties` | N
animation | String | slide | 轮播切换动画效果类型。可选项:slide | N
autoplay | Boolean | true | 是否自动播放 | N
current | Number | 0 | 当前轮播在哪一项(下标) | N
defaultCurrent | Number | 0 | 当前轮播在哪一项(下标)。非受控属性 | N
direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
duration | Number | 300 | 滑动动画时长 | N
height | String / Number | - | 当使用垂直方向滚动时的高度 | N
interval | Number | 5000 | 轮播间隔时间 | N
loop | Boolean | true | 是否循环播放 | N
navigation | TNode | - | 导航器全部配置。TS 类型:`SwiperNavigation \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
navigation | TNode | true | 导航器全部配置,`true` 的话使用默认配置。TS 类型:`SwiperNavigation \| TNode \| Boolean`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-react/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | 后边距,可用于露出后一项的一小部分。默认单位 `px` | N
previousMargin | String / Number | 0 | 前边距,可用于露出前一项的一小部分。默认单位 `px` | N
type | String | default | 样式类型:默认样式、卡片样式。可选项:default/card | N
Expand Down
5 changes: 3 additions & 2 deletions packages/products/tdesign-mobile-react/src/swiper/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ export interface TdSwiperProps {
*/
loop?: boolean;
/**
* 导航器全部配置
* 导航器全部配置,`true` 的话使用默认配置
* @default true
*/
navigation?: SwiperNavigation | TNode;
navigation?: SwiperNavigation | TNode | Boolean;
/**
* 后边距,可用于露出后一项的一小部分。默认单位 `px`
* @default 0
Expand Down
5 changes: 3 additions & 2 deletions packages/products/tdesign-mobile-vue/src/swiper/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ export default {
type: Boolean,
default: true,
},
/** 导航器全部配置 */
/** 导航器全部配置,`true` 的话使用默认配置 */
navigation: {
type: [Object, Function] as PropType<TdSwiperProps['navigation']>,
type: [Boolean, Object, Function] as PropType<TdSwiperProps['navigation']>,
default: true as TdSwiperProps['navigation'],
},
/** 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` */
nextMargin: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
:: BASE_DOC ::

## API
### Swiper Props

name | type | default | description | required
-- | -- | -- | -- | --
animation | String | slide | options: slide | N
autoplay | Boolean | true | \- | N
current | Number | 0 | `v-model` and `v-model:current` is supported | N
defaultCurrent | Number | 0 | uncontrolled property | N
direction | String | horizontal | options: horizontal/vertical | N
duration | Number | 300 | \- | N
height | String / Number | - | \- | N
interval | Number | 5000 | \- | N
loop | Boolean | true | \- | N
navigation | Boolean / Object / Function / Slot / Function | true | Typescript:`SwiperNavigation \| TNode \| Function \| Boolean `。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | \- | N
previousMargin | String / Number | 0 | \- | N
onChange | Function | | Typescript:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
onClick | Function | | Typescript:`(index: number) => void`<br/> | N

### Swiper Events

name | params | description
-- | -- | --
change | `(current: number, context: { source: SwiperChangeSource })` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
click | `(index: number)` | \-

### SwiperNavigation

name | type | default | description | required
-- | -- | -- | -- | --
minShowNum | Number | - | \- | N
paginationPosition | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
showControls | Boolean | false | \- | N
type | String | - | Typescript:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts) | N

## API
### Swiper Props

name | type | default | description | required
Expand All @@ -15,7 +50,43 @@ duration | Number | 300 | \- | N
height | String / Number | - | \- | N
interval | Number | 5000 | \- | N
loop | Boolean | true | \- | N
navigation | Object / Slot / Function | - | Typescript:`SwiperNavigation \| TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
navigation | Boolean / Object / Function / Slot / Function | true | Typescript:`SwiperNavigation \| TNode \| Function \| Boolean `。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | \- | N
previousMargin | String / Number | 0 | \- | N
onChange | Function | | Typescript:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
onClick | Function | | Typescript:`(index: number) => void`<br/> | N

### Swiper Events

name | params | description
-- | -- | --
change | `(current: number, context: { source: SwiperChangeSource })` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
click | `(index: number)` | \-

### SwiperNavigation

name | type | default | description | required
-- | -- | -- | -- | --
minShowNum | Number | - | \- | N
paginationPosition | String | bottom | options: top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
showControls | Boolean | false | \- | N
type | String | - | Typescript:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts) | N

## API

### Swiper Props

name | type | default | description | required
-- | -- | -- | -- | --
animation | String | slide | options: slide | N
autoplay | Boolean | true | \- | N
current | Number | 0 | `v-model` and `v-model:current` is supported | N
direction | String | horizontal | options: horizontal/vertical | N
duration | Number | 300 | \- | N
height | String / Number | - | \- | N
interval | Number | 5000 | \- | N
loop | Boolean | true | \- | N
navigation | Boolean / Object / Slot / Function | true | navigation all config, `true` for using default config。Typescript:`SwiperNavigation \| TNode \| Boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | \- | N
previousMargin | String / Number | 0 | \- | N
onChange | Function | | Typescript:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
Expand Down
73 changes: 72 additions & 1 deletion packages/products/tdesign-mobile-vue/src/swiper/swiper.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,42 @@
:: BASE_DOC ::

## API
### Swiper Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
animation | String | slide | 轮播切换动画效果类型。可选项:slide | N
autoplay | Boolean | true | 是否自动播放 | N
current | Number | 0 | 当前轮播在哪一项(下标)。支持语法糖 `v-model` 或 `v-model:current` | N
defaultCurrent | Number | 0 | 当前轮播在哪一项(下标)。非受控属性 | N
direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
duration | Number | 300 | 滑动动画时长 | N
height | String / Number | - | 轮播的高度 | N
interval | Number | 5000 | 轮播间隔时间 | N
loop | Boolean | true | 是否循环播放 | N
navigation | Boolean / Object / Function / Slot / Function | true | 导航器全部配置。TS 类型:`SwiperNavigation \| TNode \| Function \| Boolean `。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` | N
previousMargin | String / Number | 0 | 【开发中】前边距,可用于露出前一项的一小部分。默认单位 `px` | N
onChange | Function | | TS 类型:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
onClick | Function | | TS 类型:`(index: number) => void`<br/>点击轮播项时触发 | N

### Swiper Events

名称 | 参数 | 描述
-- | -- | --
change | `(current: number, context: { source: SwiperChangeSource })` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
click | `(index: number)` | 点击轮播项时触发

### SwiperNavigation

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
minShowNum | Number | - | 小于这个数字不会显示导航器 | N
paginationPosition | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
showControls | Boolean | false | 是否显示两侧的控制按钮 | N
type | String | - | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts) | N

## API
### Swiper Props

名称 | 类型 | 默认值 | 描述 | 必传
Expand All @@ -15,7 +50,43 @@ duration | Number | 300 | 滑动动画时长 | N
height | String / Number | - | 轮播的高度 | N
interval | Number | 5000 | 轮播间隔时间 | N
loop | Boolean | true | 是否循环播放 | N
navigation | Object / Slot / Function | - | 导航器全部配置。TS 类型:`SwiperNavigation \| TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
navigation | Boolean / Object / Function / Slot / Function | true | 导航器全部配置。TS 类型:`SwiperNavigation \| TNode \| Function \| Boolean `。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` | N
previousMargin | String / Number | 0 | 【开发中】前边距,可用于露出前一项的一小部分。默认单位 `px` | N
onChange | Function | | TS 类型:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
onClick | Function | | TS 类型:`(index: number) => void`<br/>点击轮播项时触发 | N

### Swiper Events

名称 | 参数 | 描述
-- | -- | --
change | `(current: number, context: { source: SwiperChangeSource })` | 轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/>
click | `(index: number)` | 点击轮播项时触发

### SwiperNavigation

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
minShowNum | Number | - | 小于这个数字不会显示导航器 | N
paginationPosition | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
showControls | Boolean | false | 是否显示两侧的控制按钮 | N
type | String | - | 导航器类型,点状(dots)、点条状(dots-bar)、分式(fraction)等。TS 类型:`SwiperNavigationType` `type SwiperNavigationType = 'dots' \| 'dots-bar' \| 'fraction'`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts) | N

## API

### Swiper Props

名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
animation | String | slide | 轮播切换动画效果类型。可选项:slide | N
autoplay | Boolean | true | 是否自动播放 | N
current | Number | 0 | 当前轮播在哪一项(下标)。支持语法糖 `v-model` 或 `v-model:current` | N
direction | String | horizontal | 轮播滑动方向,包括横向滑动和纵向滑动两个方向。可选项:horizontal/vertical | N
duration | Number | 300 | 滑动动画时长 | N
height | String / Number | - | 轮播的高度 | N
interval | Number | 5000 | 轮播间隔时间 | N
loop | Boolean | true | 是否循环播放 | N
navigation | Boolean / Object / Slot / Function | true | 导航器全部配置,`true` 的话使用默认配置。TS 类型:`SwiperNavigation \| TNode \| Boolean`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N
nextMargin | String / Number | 0 | 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px` | N
previousMargin | String / Number | 0 | 【开发中】前边距,可用于露出前一项的一小部分。默认单位 `px` | N
onChange | Function | | TS 类型:`(current: number, context: { source: SwiperChangeSource }) => void`<br/>轮播切换时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/swiper/type.ts)。<br/>`type SwiperChangeSource = 'autoplay' \| 'touch' \| 'nav'`<br/> | N
Expand Down
5 changes: 3 additions & 2 deletions packages/products/tdesign-mobile-vue/src/swiper/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ export interface TdSwiperProps {
*/
loop?: boolean;
/**
* 导航器全部配置
* 导航器全部配置,`true` 的话使用默认配置
* @default true
*/
navigation?: SwiperNavigation | TNode;
navigation?: SwiperNavigation | TNode | Boolean;
/**
* 【开发中】后边距,可用于露出后一项的一小部分。默认单位 `px`
* @default 0
Expand Down
Loading