-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(tdesign-mobile-vue/image-viewer): 更新image-viewer api (#291)
* refactor(tdesign-mobile-vue/image-viewer): 更新image-viewer api * fix: 修复mobile vue image-viewer单独属性设置问题 * chore: json to db * feat: update platform_framework --------- Co-authored-by: 黎伟杰 <674416404@qq.com>
- Loading branch information
1 parent
448efd2
commit c4c1fd3
Showing
6 changed files
with
172 additions
and
8 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
packages/products/tdesign-mobile-vue/src/image-viewer/props.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TdImageViewerProps } from './type'; | ||
import { PropType } from 'vue'; | ||
|
||
export default { | ||
/** 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;也可以完全自定义关闭按钮 */ | ||
closeBtn: { | ||
type: [Boolean, Function] as PropType<TdImageViewerProps['closeBtn']>, | ||
default: true, | ||
}, | ||
/** 是否显示删除操作,前提需要开启页码 */ | ||
deleteBtn: { | ||
type: [Boolean, Function] as PropType<TdImageViewerProps['deleteBtn']>, | ||
default: false, | ||
}, | ||
/** 图片数组 */ | ||
images: { | ||
type: Array as PropType<TdImageViewerProps['images']>, | ||
default: (): TdImageViewerProps['images'] => [], | ||
}, | ||
/** 当前预览图片所在的下标 */ | ||
index: { | ||
type: Number, | ||
default: undefined, | ||
}, | ||
/** 当前预览图片所在的下标,非受控属性 */ | ||
defaultIndex: { | ||
type: Number, | ||
}, | ||
/** 【开发中】最大放大比例 */ | ||
maxZoom: { | ||
type: Number, | ||
default: 3, | ||
}, | ||
/** 是否显示页码 */ | ||
showIndex: Boolean, | ||
/** 隐藏/显示预览 */ | ||
visible: { | ||
type: Boolean, | ||
default: undefined, | ||
}, | ||
modelValue: { | ||
type: Boolean, | ||
default: undefined, | ||
}, | ||
/** 隐藏/显示预览,非受控属性 */ | ||
defaultVisible: Boolean, | ||
/** 关闭时触发 */ | ||
onClose: Function as PropType<TdImageViewerProps['onClose']>, | ||
/** 点击删除操作按钮时触发 */ | ||
onDelete: Function as PropType<TdImageViewerProps['onDelete']>, | ||
/** 预览图片切换时触发,`context.prev` 切换到上一张图片,`context.next` 切换到下一张图片 */ | ||
onIndexChange: Function as PropType<TdImageViewerProps['onIndexChange']>, | ||
}; |
70 changes: 70 additions & 0 deletions
70
packages/products/tdesign-mobile-vue/src/image-viewer/type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* eslint-disable */ | ||
|
||
/** | ||
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC | ||
* */ | ||
|
||
import { TNode } from '../common'; | ||
|
||
export interface TdImageViewerProps { | ||
/** | ||
* 是否展示关闭按钮,值为 `true` 显示默认关闭按钮;值为 `false` 则不显示关闭按钮;也可以完全自定义关闭按钮 | ||
* @default true | ||
*/ | ||
closeBtn?: boolean | TNode; | ||
/** | ||
* 是否显示删除操作,前提需要开启页码 | ||
* @default false | ||
*/ | ||
deleteBtn?: boolean | TNode; | ||
/** | ||
* 图片数组 | ||
* @default [] | ||
*/ | ||
images?: Array<string | { url: string; align: 'start' | 'center' | 'end' }>; | ||
/** | ||
* 当前预览图片所在的下标 | ||
*/ | ||
index?: number; | ||
/** | ||
* 当前预览图片所在的下标,非受控属性 | ||
*/ | ||
defaultIndex?: number; | ||
/** | ||
* 【开发中】最大放大比例 | ||
* @default 3 | ||
*/ | ||
maxZoom?: Number; | ||
/** | ||
* 是否显示页码 | ||
* @default false | ||
*/ | ||
showIndex?: boolean; | ||
/** | ||
* 隐藏/显示预览 | ||
* @default false | ||
*/ | ||
visible?: boolean; | ||
/** | ||
* 隐藏/显示预览,非受控属性 | ||
* @default false | ||
*/ | ||
defaultVisible?: boolean; | ||
/** | ||
* 隐藏/显示预览 | ||
* @default false | ||
*/ | ||
modelValue?: boolean; | ||
/** | ||
* 关闭时触发 | ||
*/ | ||
onClose?: (context: { trigger: 'overlay' | 'close-btn'; visible: Boolean; index: Number }) => void; | ||
/** | ||
* 点击删除操作按钮时触发 | ||
*/ | ||
onDelete?: (index: Number) => void; | ||
/** | ||
* 预览图片切换时触发,`context.prev` 切换到上一张图片,`context.next` 切换到下一张图片 | ||
*/ | ||
onIndexChange?: (index: number, context: { trigger: 'prev' | 'next' }) => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters