-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
38 lines (34 loc) · 951 Bytes
/
main.js
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
import { YouEtag } from './lib/main.js'
document.querySelector('#app').innerHTML = `
<div>
<a href="https://vitejs.dev" target="_blank">
<img src="/vite.svg" class="logo" alt="Vite logo" />
</a>
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" target="_blank">
</a>
<h1>Hello Vite!</h1>
<laber for="file">
<button id="counter" type="button">buttonbutton</button>
<input type="file" id="file" name="file" />
</laber>
<p class="read-the-docs">
Click on the Vite logo to learn more
</p>
</div>
`
document.querySelector('#file').onchange = function(e) {
let files = e.target.files
Array.from(files).forEach(file => {
YouEtag({
file: file,
// size: 5*1024*1024
progress: (res=>{
console.log('progress',res)
}),
}).then(file=>{
console.dir(file)
}).catch(err=>{
console.log('err',err)
})
});
}