Merge pull request #3780 from sezisfurkan/issue-3492

Image: Indicator icon props added
pull/3798/head
Tuğçe Küçükoğlu 2023-03-24 16:42:36 +03:00 committed by GitHub
commit f16095b00f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -27,6 +27,11 @@ export interface ImageProps {
* Style class of the image element.
*/
imageClass?: any;
/**
* Custom indicator icon.
* @defaultValue pi pi-eye
*/
indicatorIcon?: string;
}
/**

View File

@ -3,7 +3,7 @@
<img v-bind="$attrs" :style="imageStyle" :class="imageClass" @error="onError" />
<button v-if="preview" ref="previewButton" class="p-image-preview-indicator" @click="onImageClick" v-bind="previewButtonProps">
<slot name="indicator">
<i class="p-image-preview-icon pi pi-eye"></i>
<i :class="['p-image-preview-icon', indicatorIcon]"></i>
</slot>
</button>
<Portal>
@ -82,6 +82,10 @@ export default {
previewButtonProps: {
type: null,
default: null
},
indicatorIcon: {
type: String,
default: 'pi pi-eye'
}
},
mask: null,