Update
This commit is contained in:
@ -25,7 +25,11 @@
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let open = false;
|
||||
interface Props {
|
||||
open?: boolean;
|
||||
}
|
||||
|
||||
let { open = $bindable(false) }: Props = $props();
|
||||
|
||||
async function upload() {
|
||||
if (uploadFile == null) {
|
||||
@ -53,15 +57,17 @@
|
||||
dispatch("reset")
|
||||
}
|
||||
|
||||
let uploadFile: FileList | null = null;
|
||||
let uploadFile: FileList | null = $state(null);
|
||||
</script>
|
||||
|
||||
<SWModal title={t("dashboard.schematic.title")} bind:open>
|
||||
<form>
|
||||
<input type="file" bind:files={uploadFile} />
|
||||
</form>
|
||||
<svelte:fragment slot="footer">
|
||||
<button class="btn !ml-auto" on:click={upload}>{t("dashboard.schematic.upload")}</button>
|
||||
<button class="btn btn-gray" on:click={() => open = false}>{t("dashboard.schematic.cancel")}</button>
|
||||
</svelte:fragment>
|
||||
{#snippet footer()}
|
||||
|
||||
<button class="btn !ml-auto" onclick={upload}>{t("dashboard.schematic.upload")}</button>
|
||||
<button class="btn btn-gray" onclick={() => open = false}>{t("dashboard.schematic.cancel")}</button>
|
||||
|
||||
{/snippet}
|
||||
</SWModal>
|
||||
Reference in New Issue
Block a user