migrate: convert most components to svelte 5

This commit is contained in:
Xylight committed 2024-10-25 19:33:27 -07:00
1 parent d670f39f0a
commit 10ef4123da
225 files changed
+5441 -3341

No files matched your search

+9 -4
View File
@@ -3,7 +3,7 @@
// https://github.com/sveltejs/svelte/issues/3088#issuecomment-505785516
import { onMount, onDestroy, createEventDispatcher } from 'svelte'
let slottedElements: HTMLDivElement, portal: HTMLDivElement
let slottedElements: HTMLDivElement = $state(), portal: HTMLDivElement
const dispatch = createEventDispatcher<{ mounted: void }>()
@@ -20,13 +20,18 @@
portal.remove()
})
let clazz: string = ''
export { clazz as class }
interface Props {
class?: string;
children?: import('svelte').Snippet;
}
let { class: clazz = '', children }: Props = $props();
</script>
<div class="portal-initial-mount-point">
<div bind:this={slottedElements} class="portal-content {clazz || ''}">
<slot />
{@render children?.()}
</div>
</div>