mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
b639e04074
* fixes * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
24 lines
541 B
Svelte
24 lines
541 B
Svelte
<script lang="ts">
|
|
import type { HTMLImgAttributes } from "svelte/elements";
|
|
type $$Props = HTMLImgAttributes;
|
|
|
|
import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
|
|
export let src: HTMLImgAttributes["src"] = undefined;
|
|
</script>
|
|
|
|
{#await resolve_wasm_src(src) then resolved_src}
|
|
<!-- svelte-ignore a11y-missing-attribute -->
|
|
<img src={resolved_src} {...$$restProps} />
|
|
{:catch error}
|
|
<p style="color: red;">{error.message}</p>
|
|
{/await}
|
|
|
|
<style>
|
|
img {
|
|
width: 100%;
|
|
height: 100%;
|
|
border-radius: var(--radius-lg);
|
|
}
|
|
</style>
|