Merge pull request #3780 from sezisfurkan/issue-3492
Image: Indicator icon props addedpull/3798/head
commit
f16095b00f
|
@ -27,6 +27,11 @@ export interface ImageProps {
|
||||||
* Style class of the image element.
|
* Style class of the image element.
|
||||||
*/
|
*/
|
||||||
imageClass?: any;
|
imageClass?: any;
|
||||||
|
/**
|
||||||
|
* Custom indicator icon.
|
||||||
|
* @defaultValue pi pi-eye
|
||||||
|
*/
|
||||||
|
indicatorIcon?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<img v-bind="$attrs" :style="imageStyle" :class="imageClass" @error="onError" />
|
<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">
|
<button v-if="preview" ref="previewButton" class="p-image-preview-indicator" @click="onImageClick" v-bind="previewButtonProps">
|
||||||
<slot name="indicator">
|
<slot name="indicator">
|
||||||
<i class="p-image-preview-icon pi pi-eye"></i>
|
<i :class="['p-image-preview-icon', indicatorIcon]"></i>
|
||||||
</slot>
|
</slot>
|
||||||
</button>
|
</button>
|
||||||
<Portal>
|
<Portal>
|
||||||
|
@ -82,6 +82,10 @@ export default {
|
||||||
previewButtonProps: {
|
previewButtonProps: {
|
||||||
type: null,
|
type: null,
|
||||||
default: null
|
default: null
|
||||||
|
},
|
||||||
|
indicatorIcon: {
|
||||||
|
type: String,
|
||||||
|
default: 'pi pi-eye'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mask: null,
|
mask: null,
|
||||||
|
|
Loading…
Reference in New Issue