Refactor #4274 - For Image

pull/3943/head^2
Tuğçe Küçükoğlu 2023-08-16 09:40:12 +03:00
parent c4b7221efb
commit 07dae2e611
2 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ export interface ImageSlots {
/** /**
* Image error function. * Image error function.
*/ */
onError: void; onError(): void;
}): VNode[]; }): VNode[];
/** /**
* Custom preview template. * Custom preview template.
@ -249,7 +249,7 @@ export interface ImageSlots {
/** /**
* Preview click function. * Preview click function.
*/ */
onClick: void; onClick(): void;
}): VNode[]; }): VNode[];
} }

View File

@ -43,7 +43,7 @@
</div> </div>
<transition name="p-image-preview" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" @before-leave="onBeforeLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')"> <transition name="p-image-preview" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" @before-leave="onBeforeLeave" @after-leave="onAfterLeave" v-bind="ptm('transition')">
<div v-if="previewVisible" v-bind="ptm('previewContainer')"> <div v-if="previewVisible" v-bind="ptm('previewContainer')">
<slot name="preview" :style="imagePreviewStyle" :onClick="onPreviewImageClick"> <slot name="preview" :class="cx('preview')" :style="imagePreviewStyle" :onClick="onPreviewImageClick">
<img :src="$attrs.src" :class="cx('preview')" :style="imagePreviewStyle" @click="onPreviewImageClick" v-bind="ptm('preview')" /> <img :src="$attrs.src" :class="cx('preview')" :style="imagePreviewStyle" @click="onPreviewImageClick" v-bind="ptm('preview')" />
</slot> </slot>
</div> </div>