From 2eec11b8d849c73513a083eca7b58005cde1ee20 Mon Sep 17 00:00:00 2001 From: tugcekucukoglu Date: Mon, 6 May 2024 13:45:36 +0300 Subject: [PATCH] Refactor #5682, #5683 - For Image --- components/lib/image/BaseImage.vue | 4 ++++ components/lib/image/Image.d.ts | 37 ++++++++++++++++++++++++++++-- components/lib/image/Image.vue | 8 ++++--- doc/image/TemplateDoc.vue | 10 ++++---- 4 files changed, 49 insertions(+), 10 deletions(-) diff --git a/components/lib/image/BaseImage.vue b/components/lib/image/BaseImage.vue index 1b0236e27..6aedcb3cb 100644 --- a/components/lib/image/BaseImage.vue +++ b/components/lib/image/BaseImage.vue @@ -34,6 +34,10 @@ export default { type: String, default: undefined }, + previewIcon: { + type: String, + default: undefined + }, zoomInDisabled: { type: Boolean, default: false diff --git a/components/lib/image/Image.d.ts b/components/lib/image/Image.d.ts index e2497065d..eb561fe33 100644 --- a/components/lib/image/Image.d.ts +++ b/components/lib/image/Image.d.ts @@ -186,9 +186,13 @@ export interface ImageProps { imageClass?: any; /** * Custom indicator icon. - * @deprecated since v3.27.0. Use 'indicatoricon' slot. + * @deprecated since v4.0. Use 'previewIcon' prop instead. */ - indicatorIcon?: string; + indicatorIcon?: string | undefined; + /** + * Custom indicator icon. + */ + previewIcon?: string | undefined; /** * Disable the zoom-in button * @defaultValue false @@ -227,6 +231,11 @@ export interface ImageSlots { /** * Custom indicator template. */ + previewicon(): VNode[]; + /** + * @deprecated since v4.0. Use 'previewicon' slot instead. + * Custom indicator template. + */ indicatoricon(): VNode[]; /** * Custom refresh template. @@ -272,6 +281,7 @@ export interface ImageSlots { errorCallback: () => void; }): VNode[]; /** + * @deprecated since v4.0. use 'original' slot instead. * Custom preview template. * @param {Object} scope - preview slot's params. */ @@ -294,6 +304,29 @@ export interface ImageSlots { */ previewCallback: () => void; }): VNode[]; + /** + * Custom original template. + * @param {Object} scope - original slot's params. + */ + original(scope: { + /** + * Style class of the original image element. + */ + class: any; + /** + * Style of the original image element. + */ + style: any; + /** + * Original click function. + * @deprecated since v3.39.0. Use 'previewCallback' property instead. + */ + onClick: () => void; + /** + * Preview click function. + */ + previewCallback: () => void; + }): VNode[]; } export interface ImageEmits {} diff --git a/components/lib/image/Image.vue b/components/lib/image/Image.vue index a7aa752c9..b3bd471f9 100644 --- a/components/lib/image/Image.vue +++ b/components/lib/image/Image.vue @@ -4,8 +4,9 @@ @@ -43,7 +44,8 @@
- + +
diff --git a/doc/image/TemplateDoc.vue b/doc/image/TemplateDoc.vue index a513cb502..5add98922 100644 --- a/doc/image/TemplateDoc.vue +++ b/doc/image/TemplateDoc.vue @@ -1,13 +1,13 @@