commit
db82eb8987
|
@ -52,6 +52,10 @@ const ImageSlots = [
|
||||||
{
|
{
|
||||||
name: 'close',
|
name: 'close',
|
||||||
description: 'Custom content for the component close.'
|
description: 'Custom content for the component close.'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'imagePreview',
|
||||||
|
description: 'Custom content for the component preview.'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,10 @@ export interface ImageSlots {
|
||||||
* Custom close template.
|
* Custom close template.
|
||||||
*/
|
*/
|
||||||
close(): VNode[];
|
close(): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom preview template.
|
||||||
|
*/
|
||||||
|
imagePreview(): VNode[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ImageEmits {}
|
export interface ImageEmits {}
|
||||||
|
|
|
@ -41,7 +41,9 @@
|
||||||
</div>
|
</div>
|
||||||
<transition name="p-image-preview" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" @before-leave="onBeforeLeave" @after-leave="onAfterLeave">
|
<transition name="p-image-preview" @before-enter="onBeforeEnter" @enter="onEnter" @leave="onLeave" @before-leave="onBeforeLeave" @after-leave="onAfterLeave">
|
||||||
<div v-if="previewVisible">
|
<div v-if="previewVisible">
|
||||||
<img :src="$attrs.src" class="p-image-preview" :style="imagePreviewStyle" @click="onPreviewImageClick" />
|
<slot name="imagePreview" :previewImageClick="onPreviewImageClick" :imagePreviewStyle="imagePreviewStyle">
|
||||||
|
<img :src="$attrs.src" class="p-image-preview" :style="imagePreviewStyle" @click="onPreviewImageClick" />
|
||||||
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,8 +3,13 @@
|
||||||
<p>Enabling <i>preview</i> mode displays a modal layer when the image is clicked to provide transformation options such as rotating and zooming.</p>
|
<p>Enabling <i>preview</i> mode displays a modal layer when the image is clicked to provide transformation options such as rotating and zooming.</p>
|
||||||
</DocSectionText>
|
</DocSectionText>
|
||||||
<div class="card flex justify-content-center">
|
<div class="card flex justify-content-center">
|
||||||
<Image src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" width="250" preview />
|
<Image src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" width="250" preview>
|
||||||
|
<template #imagePreview="slotProps">
|
||||||
|
<img src="https://primefaces.org/cdn/primevue/images/galleria/galleria10.jpg" alt="Image" :style="slotProps.imagePreviewStyle" @click="slotProps.previewImageClick" />
|
||||||
|
</template>
|
||||||
|
</Image>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DocSectionCode :code="code" />
|
<DocSectionCode :code="code" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue