filepond integration

This commit is contained in:
2020-12-30 10:37:10 +01:00
parent 3c36bea07c
commit ada68887a2
3 changed files with 34 additions and 0 deletions

View File

@@ -9,6 +9,7 @@
import NotFound from "./NotFound.svelte";
import Sidebar from "./Sidebar.svelte";
import DataTable from "./DataTable.svelte";
import FileUpload from "./FileUpload.svelte";
//
let isProfileActionsVisible = false;
let mobile_menu_opened = false;
@@ -297,6 +298,9 @@
</div>
<main>
<div class="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8">
<div class="mb-8">
<FileUpload />
</div>
<div class="mb-8">
<DataTable />
</div>

View File

@@ -0,0 +1,28 @@
<script>
import FilePond, { registerPlugin, supported } from "svelte-filepond";
let pond;
// pond.getFiles() will return the active files
// the name to use for the internal file input
let name = "filepond";
function handleInit() {
console.log("FilePond has initialised");
}
function handleAddFile(err, fileItem) {
console.log("A file has been added", fileItem);
}
</script>
<style>
@import "filepond/dist/filepond.css";
</style>
<div class="app">
<FilePond
bind:this={pond}
{name}
server="/api"
allowMultiple={false}
credits={false}
oninit={handleInit}
onaddfile={handleAddFile} />
</div>