MapComplete/UI/Base/FromHtml.svelte
2023-05-14 03:24:13 +02:00

20 lines
319 B
Svelte

<script lang="ts">
/**
* Given an HTML string, properly shows this
*/
export let src: string;
let htmlElem: HTMLElement;
$: {
if (htmlElem) {
htmlElem.innerHTML = src;
}
}
export let clss = ""
</script>
{#if src !== undefined}
<span bind:this={htmlElem} class={clss}></span>
{/if}