mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-27 05:51:56 +00:00
feat: onFileDrop
This commit is contained in:
parent
77e7c86520
commit
75d39bf58d
1 changed files with 10 additions and 1 deletions
|
|
@ -22,6 +22,15 @@
|
||||||
const dashAnimationStop = () => {
|
const dashAnimationStop = () => {
|
||||||
clearInterval(dashAnimationInterval);
|
clearInterval(dashAnimationInterval);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type Dropped = {
|
||||||
|
accepted: Array<File>;
|
||||||
|
rejected: Array<File>;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onFileDrop = (dropped: Dropped) => {
|
||||||
|
console.log(dropped);
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="card uploadCard">
|
<div class="card uploadCard">
|
||||||
|
|
@ -36,7 +45,7 @@
|
||||||
multiple={false}
|
multiple={false}
|
||||||
maxSize={filetype == 'PDF' ? 100_000_000 : 10_000_000}
|
maxSize={filetype == 'PDF' ? 100_000_000 : 10_000_000}
|
||||||
accept={filetype == 'PDF' ? 'application/pdf' : 'application/octet-stream'}
|
accept={filetype == 'PDF' ? 'application/pdf' : 'application/octet-stream'}
|
||||||
on:filedrop={null}
|
on:filedrop={(e) => onFileDrop(e.detail.files)}
|
||||||
on:filedragenter={dashAnimationStart}
|
on:filedragenter={dashAnimationStart}
|
||||||
on:filedragleave={dashAnimationStop}
|
on:filedragleave={dashAnimationStop}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue