mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #4728
This commit is contained in:
parent
e8ebb9bf3f
commit
b957ea422d
16 changed files with 74 additions and 13 deletions
10
components/lib/image/Image.d.ts
vendored
10
components/lib/image/Image.d.ts
vendored
|
@ -251,8 +251,13 @@ export interface ImageSlots {
|
|||
style: any;
|
||||
/**
|
||||
* Image error function.
|
||||
* @deprecated since v3.39.0. Use 'errorCallback' property instead.
|
||||
*/
|
||||
onError: () => void;
|
||||
/**
|
||||
* Preview click function.
|
||||
*/
|
||||
errorCallback: () => void;
|
||||
}): VNode[];
|
||||
/**
|
||||
* Custom preview template.
|
||||
|
@ -269,8 +274,13 @@ export interface ImageSlots {
|
|||
style: any;
|
||||
/**
|
||||
* Preview click function.
|
||||
* @deprecated since v3.39.0. Use 'previewCallback' property instead.
|
||||
*/
|
||||
onClick: () => void;
|
||||
/**
|
||||
* Preview click function.
|
||||
*/
|
||||
previewCallback: () => void;
|
||||
}): VNode[];
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<span :class="containerClass" :style="style" v-bind="ptm('root')" data-pc-name="image">
|
||||
<slot name="image" :onError="onError">
|
||||
<slot name="image" :onError="onError" :errorCallback="onError">
|
||||
<img :style="imageStyle" :class="[cx('image'), imageClass]" @error="onError" v-bind="{ ...$attrs, ...ptm('image') }" />
|
||||
</slot>
|
||||
<button v-if="preview" ref="previewButton" type="button" :class="cx('button')" @click="onImageClick" v-bind="{ ...previewButtonProps, ...ptm('button') }">
|
||||
|
@ -43,7 +43,7 @@
|
|||
</div>
|
||||
<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')">
|
||||
<slot name="preview" :class="cx('preview')" :style="imagePreviewStyle" :onClick="onPreviewImageClick">
|
||||
<slot name="preview" :class="cx('preview')" :style="imagePreviewStyle" :onClick="onPreviewImageClick" :previewCallback="onPreviewImageClick">
|
||||
<img :src="$attrs.src" :class="cx('preview')" :style="imagePreviewStyle" @click="onPreviewImageClick" v-bind="ptm('preview')" />
|
||||
</slot>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue