-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforget.html
62 lines (52 loc) · 1.56 KB
/
forget.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>forget</title>
</head>
<body>
<h1>forget</h1>
</body>
</html>
<!-- <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div id='app'>
<div>
<button @click="$refs.file.click()">從電腦選擇相片</button>
<input style="display:none" ref="file" type="file" @change="fileSelected" />
</div>
<img v-if="image" :src="image" width="300" />
<br />
</div>
<script src="https://unpkg.com/vue@3"></script>
<script>
const app = Vue.createApp({
data() {
return {
image: '',
}
},
methods: {
fileSelected(event) {
const file = event.target.files.item(0); //取得File物件
const reader = new FileReader(); //建立FileReader 監聽 Load 事件
reader.addEventListener('load', this.imageLoader);
reader.readAsDataURL(file);
},
imageLoader(event) {
this.image = event.target.result;
}
},
}).mount('#app')
</script>
</body>
</html> -->