2023-02-02 17:57:07 +01:00
|
|
|
<script lang="ts">
|
|
|
|
import BaseUIElement from "../BaseUIElement.js";
|
|
|
|
import { onMount } from "svelte";
|
|
|
|
|
|
|
|
export let construct: BaseUIElement | (() => BaseUIElement);
|
|
|
|
let elem: HTMLElement;
|
|
|
|
onMount(() => {
|
|
|
|
let html: HTMLElement
|
|
|
|
if (typeof construct === "function") {
|
|
|
|
html = construct().ConstructElement();
|
|
|
|
} else {
|
|
|
|
html = construct.ConstructElement();
|
|
|
|
}
|
2023-02-03 05:03:42 +01:00
|
|
|
elem.replaceWith(html)
|
2023-02-02 17:57:07 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<span bind:this={elem}></span>
|