mapcomplete/UI/Base/FromHtml.svelte

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

21 lines
319 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-04-21 18:09:14 +02:00
if (htmlElem) {
htmlElem.innerHTML = src;
2023-03-29 17:21:20 +02:00
}
}
2023-05-14 03:24:13 +02:00
export let clss = ""
2023-03-29 17:21:20 +02:00
</script>
{#if src !== undefined}
2023-05-14 03:24:13 +02:00
<span bind:this={htmlElem} class={clss}></span>
2023-03-29 17:21:20 +02:00
{/if}