Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified db/TDesign.db
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ name | params | description
close | `(context: { trigger: ImageViewerCloseTrigger, visible: boolean, index: number })` | [see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/image-viewer/type.ts)。<br/>`type ImageViewerCloseTrigger = 'image' \| 'overlay' \| 'close-btn'`<br/>
delete | `(index: number)` | \-
index-change | `(index: number, context: { trigger: 'prev' \| 'next' })` | \-

### ImageViewerInstanceFunctions 组件实例方法

name | params | return | description
-- | -- | -- | --
swipeTo | `(index: number, options?: SwiperToOptions)` | \- | `1.13.2`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/image-viewer/type.ts)。<br/>`import { SwiperToOptions } from '@Swiper'`<br/>
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ onIndexChange | Function | | TS 类型:`(index: number, context: { trigger: '
close | `(context: { trigger: ImageViewerCloseTrigger, visible: boolean, index: number })` | 关闭时触发。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/image-viewer/type.ts)。<br/>`type ImageViewerCloseTrigger = 'image' \| 'overlay' \| 'close-btn'`<br/>
delete | `(index: number)` | 点击删除操作按钮时触发
index-change | `(index: number, context: { trigger: 'prev' \| 'next' })` | 预览图片切换时触发,`context.prev` 切换到上一张图片,`context.next` 切换到下一张图片

### ImageViewerInstanceFunctions 组件实例方法

名称 | 参数 | 返回值 | 描述
-- | -- | -- | --
swipeTo | `(index: number, options?: SwiperToOptions)` | \- | `1.13.2`。切换到指定预览图片位置。[详细类型定义](https://github.com/Tencent/tdesign-mobile-vue/tree/develop/src/image-viewer/type.ts)。<br/>`import { SwiperToOptions } from '@Swiper'`<br/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { SwiperToOptions } from '../swiper';
import type { TNode } from '../common';

export interface TdImageViewerProps {
Expand Down Expand Up @@ -77,6 +78,14 @@ export interface TdImageViewerProps {
onIndexChange?: (index: number, context: { trigger: 'prev' | 'next' }) => void;
}

/** 组件实例方法 */
export interface ImageViewerInstanceFunctions {
/**
* 切换到指定预览图片位置
*/
swipeTo?: (index: number, options?: SwiperToOptions) => void;
}

export interface ImageSlotParams {
src: string;
className?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ 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
placement | String | inside | options: inside/outside | 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
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ click | `(index: number)` | 点击轮播项时触发
-- | -- | -- | -- | --
minShowNum | Number | - | 小于这个数字不会显示导航器 | N
paginationPosition | String | bottom | 页码信息展示位置。可选项:top-left/top/top-right/bottom-left/bottom/bottom-right/left/right | N
placement | String | inside | 导航器位置,位于主体的内侧或是外侧。可选项:inside/outside | 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
5 changes: 5 additions & 0 deletions packages/products/tdesign-mobile-vue/src/swiper/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export interface SwiperNavigation {
* @default bottom
*/
paginationPosition?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right' | 'left' | 'right';
/**
* 导航器位置,位于主体的内侧或是外侧
* @default inside
*/
placement?: 'inside' | 'outside';
/**
* 是否显示两侧的控制按钮
* @default false
Expand Down
35 changes: 35 additions & 0 deletions packages/scripts/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -74249,6 +74249,39 @@
],
"field_type_text": []
},
{
"id": 1774433543,
"platform_framework": [
"8"
],
"component": "ImageViewer",
"field_category": 4,
"field_name": "swipeTo",
"field_type": [],
"field_default_value": "",
"field_enum": "",
"field_desc_zh": "切换到指定预览图片位置",
"field_desc_en": null,
"field_required": 0,
"event_input": "(index: number, options?: SwiperToOptions)【import { SwiperToOptions } from '@Swiper'】",
"create_time": "2026-03-25 10:12:23",
"update_time": "2026-03-25 10:12:23",
"event_output": null,
"custom_field_type": null,
"syntactic_sugar": null,
"readonly": 1,
"html_attribute": 0,
"trigger_elements": "",
"deprecated": 0,
"version": "{\n\"Vue(Mobile)\": \"1.13.2\"\n}",
"test_description": null,
"support_default_value": 0,
"field_category_text": "Functions",
"platform_framework_text": [
"Vue(Mobile)"
],
"field_type_text": []
},
{
"id": 1759199178,
"platform_framework": [
Expand Down Expand Up @@ -125071,6 +125104,7 @@
{
"id": 1734341852,
"platform_framework": [
"8",
"16"
],
"component": "SwiperNavigation",
Expand Down Expand Up @@ -125099,6 +125133,7 @@
"support_default_value": 0,
"field_category_text": "Props",
"platform_framework_text": [
"Vue(Mobile)",
"React(Mobile)"
],
"field_type_text": [
Expand Down