forked from open-webui/open-webui
feat: image preview
This commit is contained in:
parent
d84185f857
commit
79615f26da
3 changed files with 82 additions and 2 deletions
18
src/lib/components/common/Image.svelte
Normal file
18
src/lib/components/common/Image.svelte
Normal file
|
@ -0,0 +1,18 @@
|
|||
<script lang="ts">
|
||||
import ImagePreview from './ImagePreview.svelte';
|
||||
|
||||
export let src = '';
|
||||
export let alt = '';
|
||||
|
||||
let showImagePreview = false;
|
||||
</script>
|
||||
|
||||
<ImagePreview bind:show={showImagePreview} {src} {alt} />
|
||||
<button
|
||||
on:click={() => {
|
||||
console.log('image preview');
|
||||
showImagePreview = true;
|
||||
}}
|
||||
>
|
||||
<img {src} {alt} class=" max-h-96 rounded-lg" draggable="false" />
|
||||
</button>
|
Loading…
Add table
Add a link
Reference in a new issue