mapcomplete/UI/Base/FromHtml.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
337 B
Svelte
Raw Normal View History

2023-03-29 17:21:20 +02:00
<script lang="ts">
/**
* Given an HTML string, properly shows this
*/
export let src: string
let htmlElem: HTMLElement
2023-03-29 17:21:20 +02:00
$: {
2023-04-21 18:09:14 +02:00
if (htmlElem) {
htmlElem.innerHTML = src
2023-03-29 17:21:20 +02:00
}
}
export let clss: string | undefined = undefined
2023-03-29 17:21:20 +02:00
</script>
{#if src !== undefined}
<span bind:this={htmlElem} class={clss} />
2023-03-29 17:21:20 +02:00
{/if}