🚧 First svelte component

This commit is contained in:
wjtje 2023-01-17 18:31:51 +01:00 committed by Pieter Vander Vennet
parent 1c1df43bf9
commit 203d1b6b34
10 changed files with 809 additions and 668 deletions

View file

@ -0,0 +1,21 @@
import BaseUIElement from "../BaseUIElement"
export default class SvelteUIElement extends BaseUIElement {
private readonly _svelteComponent
private readonly _props: Record<string, any>
constructor(svelteElement, props: Record<string, any>) {
super()
this._svelteComponent = svelteElement
this._props = props
}
protected InnerConstructElement(): HTMLElement {
const el = document.createElement("div")
new this._svelteComponent({
target: el,
props: this._props,
})
return el
}
}