forked from MapComplete/MapComplete
Fix: disable crash in settings by improving typing
This commit is contained in:
parent
f1dc2c30c0
commit
edbfc5f86b
4 changed files with 19 additions and 5 deletions
|
|
@ -25,12 +25,20 @@ export default class SvelteUIElement<
|
|||
private tag: "div" | "span" = "div"
|
||||
public readonly isSvelte = true
|
||||
|
||||
constructor(svelteElement, props?: Props, events?: Events, slots?: Slots) {
|
||||
constructor(svelteElement : {
|
||||
new (args: {
|
||||
target: HTMLElement
|
||||
props: Props
|
||||
events?: Events
|
||||
slots?: Slots
|
||||
}): SvelteComponentTyped<Props, Events, Slots>
|
||||
}, props?: Props, events?: Events, slots?: Slots) {
|
||||
super()
|
||||
this._svelteComponent = <any>svelteElement
|
||||
this._props = props ?? <Props>{}
|
||||
this._events = events
|
||||
this._slots = slots
|
||||
console.trace("Constructing a special stack element")
|
||||
}
|
||||
|
||||
public setSpan() {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
})
|
||||
</script>
|
||||
|
||||
{#if isSvelte}
|
||||
{#if svelteElem?._svelteComponent}
|
||||
{#if svelteElem.getClass() || svelteElem.getStyle()}
|
||||
<svelte:component
|
||||
this={svelteElem?._svelteComponent}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue