File tree Expand file tree Collapse file tree 5 files changed +26
-6
lines changed
packages/components/image-viewer Expand file tree Collapse file tree 5 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ custom-style | Object | - | CSS(Cascading Style Sheets),used to set style on v
1111background-color | String | - | \- | N
1212close-btn | String / Boolean / Object | false | \- | N
1313delete-btn | String / Boolean / Object | false | \- | N
14- images | Array | [ ] | Typescript:` Array<string> ` | N
15- initial-index | Number | 0 | Typescript:` Number ` | N
14+ image-props | Object | - | ` 1.12.0 ` 。Typescript: ` ImageProps ` ,[ Image API Documents] ( ./image?tab=api ) 。[ see more ts definition] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/image-viewer/type.ts ) | N
15+ images | Array | [ ] | Typescript: ` Array<string> ` | N
16+ initial-index | Number | 0 | Typescript: ` Number ` | N
1617lazy | Boolean | true | ` 1.9.4 ` | N
1718show-index | Boolean | false | \- | N
1819using-custom-navbar | Boolean | false | ` v1.1.4 ` | N
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场
5757background-color | String | - | 遮罩的背景颜色 | N
5858close-btn | String / Boolean / Object | false | 是否显示关闭操作,前提需要开启页码。值为字符串表示图标名称,值为 ` true ` 表示使用默认图标 ` close ` ,值为 ` Object ` 类型,表示透传至 ` icon ` ,不传表示不显示图标 | N
5959delete-btn | String / Boolean / Object | false | 是否显示删除操作,前提需要开启页码。值为字符串表示图标名称,值为 ` true ` 表示使用默认图标 ` delete ` ,值为 ` Object ` 类型,表示透传至 ` icon ` ,不传表示不显示图标 | N
60+ image-props | Object | - | ` 1.12.0 ` 。透传至 Image 组件。TS 类型:` ImageProps ` ,[ Image API Documents] ( ./image?tab=api ) 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/blob/develop/packages/components/image-viewer/type.ts ) | N
6061images | Array | [ ] | 图片数组。TS 类型:` Array<string> ` | N
6162initial-index | Number | 0 | 初始化页码。TS 类型:` Number ` | N
6263lazy | Boolean | true | ` 1.9.4 ` 。是否开启图片懒加载。开启后会预加载当前图片、相邻图片 | N
Original file line number Diff line number Diff line change 3434 <swiper-item wx:for="{{images}}" wx:key="index" class="{{classPrefix}}__preview-image">
3535 <t-image
3636 wx:if="{{!lazy || utils.shouldLoadImage(index, currentSwiperIndex, loadedImageIndexes) }}"
37- t-class="t-image--external"
37+ t-class="{{prefix}}-image--external"
38+ class="{{classPrefix}}__image"
3839 style="{{imagesStyle[index].style || ''}}"
39- mode="aspectFit"
40- src="{{item}}"
4140 data-index="{{index}}"
42- class="{{classPrefix}}__image"
41+ src="{{item}}"
42+ mode="{{imageProps && imageProps.mode || 'aspectFit'}}"
43+ lazy="{{imageProps && imageProps.lazy || false}}"
44+ loading="{{imageProps && imageProps.loading || 'default'}}"
45+ shape="{{imageProps && imageProps.shape || 'square'}}"
46+ webp="{{imageProps && imageProps.webp || false}}"
47+ show-menu-by-longpress="{{imageProps && imageProps.showMenuByLongpress || false}}"
4348 bindload="onImageLoadSuccess"
4449 ></t-image>
4550 </swiper-item>
Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ const props: TdImageViewerProps = {
2121 type : null ,
2222 value : false ,
2323 } ,
24+ /** 透传至 Image 组件 */
25+ imageProps : {
26+ type : Object ,
27+ } ,
2428 /** 图片数组 */
2529 images : {
2630 type : Array ,
Original file line number Diff line number Diff line change 44 * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55 * */
66
7+ import { ImageProps } from '../image/index' ;
8+
79export interface TdImageViewerProps {
810 /**
911 * 遮罩的背景颜色
@@ -29,6 +31,13 @@ export interface TdImageViewerProps {
2931 type : null ;
3032 value ?: string | boolean | object ;
3133 } ;
34+ /**
35+ * 透传至 Image 组件
36+ */
37+ imageProps ?: {
38+ type : ObjectConstructor ;
39+ value ?: ImageProps ;
40+ } ;
3241 /**
3342 * 图片数组
3443 * @default []
You can’t perform that action at this time.
0 commit comments