From 43a85f5b3935b9c82d8fe9b16f38da2fd675c2b2 Mon Sep 17 00:00:00 2001 From: Hooray <304327508@qq.com> Date: Wed, 2 Jul 2025 15:16:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20`FaImagePreview`=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=BC=8F=E8=B0=83=E7=94=A8=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E5=9B=BE=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/components/FaImagePreview/index.ts | 3 +- src/ui/components/FaImagePreview/preview.vue | 40 ++++++++++++++++++-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/ui/components/FaImagePreview/index.ts b/src/ui/components/FaImagePreview/index.ts index 380fd7b3..6eff811a 100644 --- a/src/ui/components/FaImagePreview/index.ts +++ b/src/ui/components/FaImagePreview/index.ts @@ -1,13 +1,14 @@ import Preview from './preview.vue' export function useFaImagePreview() { - function open(src: string) { + function open(src: string | string[], index = 0) { const container = document.createElement('div') const app = createApp({ render() { return h(Preview, { modelValue: true, src, + index, }) }, }) diff --git a/src/ui/components/FaImagePreview/preview.vue b/src/ui/components/FaImagePreview/preview.vue index 50917a9d..8c8e160c 100644 --- a/src/ui/components/FaImagePreview/preview.vue +++ b/src/ui/components/FaImagePreview/preview.vue @@ -1,12 +1,35 @@