mapcomplete/UI/Base/FromHtml.svelte
2023-06-15 05:38:52 +02:00

19 lines
337 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: string | undefined = undefined
</script>
{#if src !== undefined}
<span bind:this={htmlElem} class={clss} />
{/if}