-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathdemo.html
54 lines (53 loc) · 1.38 KB
/
demo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Vue Image Upload and Resize Demo Page</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.17/dist/vue.js"></script>
<script src="https://unpkg.com/vue-image-upload-resize"></script>
<style>
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
</head>
<body>
<div id="app"></div>
<script type="text/x-template" id="template">
<div id="app">
<image-uploader
:preview="true"
:className="['fileinput', { 'fileinput--loaded': hasImage }]"
capture="environment"
:debug="0"
:autoRotate="true"
outputFormat="verbose"
@input="setImage"
></image-uploader>
</div>
</script>
<script>
document.addEventListener('DOMContentLoaded', function () {
new Vue({
el: '#app',
template: '#template',
data() {
return { hasImage: false }
},
methods: {
setImage: function(output) {
this.hasImage = true
console.log(output)
},
},
})
})
</script>
</body>
</html>