-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
40 lines (38 loc) · 1000 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
<div class="flex flex-col h-screen">
<div ref="dashboard"></div>
</div>
</template>
<script setup>
import Dashboard from "@uppy/dashboard";
import Tus from "@uppy/tus";
import "@uppy/core/dist/style.css";
import "@uppy/dashboard/dist/style.css";
import Uppy from "@uppy/core";
import { ref, onMounted } from "vue";
const dashboard = ref(null);
let uppy;
onMounted(() => {
uppy = new Uppy({
debug: false,
autoProceed: false,
onBeforeFileAdded: (file) => {
file.meta.bucket = "repository";
file.meta.overwrite = true;
},
});
uppy.on("upload-error", (error) => console.error(error));
uppy.use(Dashboard, {
target: dashboard.value,
inline: true,
});
uppy.use(Tus, {
endpoint: "http://localhost:9000/api/files",
retryDelays: null,
chunkSize: 64 * 1024 * 1024,
headers: {
authorization: "Bearer secret",
},
});
});
</script>