fix(image-loader): updated src should update the image

Fixes #1677

The `ImageLoader` image should correctly update if `src` changes.
This commit is contained in:
Eric Liu 2024-02-24 13:36:17 -08:00 committed by metonym
commit 0f318aac77

View file

@ -80,6 +80,7 @@
{#if loading}
<slot name="loading" />
{/if}
{#key src}
{#if loaded}
<img
style:width="100%"
@ -89,6 +90,7 @@
transition:fade|local="{{ duration: fadeIn ? fast02 : 0 }}"
/>
{/if}
{/key}
{#if error}
<slot name="error" />
{/if}
@ -97,6 +99,7 @@
{#if loading}
<slot name="loading" />
{/if}
{#key src}
{#if loaded}
<img
style:width="100%"
@ -106,6 +109,7 @@
transition:fade|local="{{ duration: fadeIn ? fast02 : 0 }}"
/>
{/if}
{/key}
{#if error}
<slot name="error" />
{/if}