-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
74 lines (65 loc) · 1.81 KB
/
index.html
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>文件上传功能实现</title>
<meta name="viewport" content="initial-scale=1" >
<link rel="stylesheet" type="text/css" href="style/index.css">
<script type="text/javascript" src="js/YLfile.js"></script>
</head>
<body>
<section class="upload">
<h1>YLfile的Demo</h1>
<div class="box">
<input type="file" multiple="multiple">
<figure class="icon"></figure>
<p>Drop your files here!</p>
</div>
<div id="preview">
</div>
<div id="plan">
<h2>{{mes}}da{{url}}</h2>
<a href="{{url}}">点击{{mes}}</a>
</div>
<script type="text/javascript">
var YL = YLfile({
paper : ".upload",
dropCell : ".box",
filesButton : ".box input",
showCell : "#preview"
}).listen();
YL.dragenter(function(e){
console.log("进入");
YL.$drop.style.borderColor = "#ff0000";
});
YL.dragleave(function(e){
console.log("离开");
YL.$drop.style.borderColor = "";
});
YL.drop(function(e){
console.log("放下");
YL.$drop.style.borderColor = "";
});
YL.$drop.onclick = function(){ YL.$filesBtn.click() };
// 待完善。。。
var data = {
mes : 'MVVM?呵呵!',
url : '/index.html'
}
var app = new YLfile.MVVM({
el : '#plan',
data : data
});
/*var app2 = YLfile.MVVM({
el : '#plan',
data : {
mes : 'MVVM?呵呵!',
url : '/index.html'
}
});*/
</script>
</section>
<div class="rang">
</div>
</body>
</html>