-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathQrcodeReader.html
More file actions
33 lines (31 loc) · 1021 Bytes
/
QrcodeReader.html
File metadata and controls
33 lines (31 loc) · 1021 Bytes
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
<html>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@3.4.1/dist/js/bootstrap.min.js" integrity="sha384-aJ21OjlMXNL5UyIl/XNwTMqvzeRMZH2w8c5cRVpzpU8Y5bApTppSuUkhZXN0VxHd" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-qrcode-reader@3.0.1/dist/VueQrcodeReader.umd.js"></script>
<body>
<div id="app">
<h1>Hello, world!</h1>
<h2>{{username}}, Again</h2>
This is Username: <input v-model="username"></input>
<qrcode-stream @decode="onDecode" @init="onInit"></qrcode-stream>
</div>
</body>
<script>
const vm = new Vue({
data: {
username: '',
message : "Hello World!"
},
methods: {
onDecode(url) {
window.location.href = url
},
onInit(promise) {
promise
.then(console.log)
.catch(console.error)
}
}
}).$mount("#app");
</script>
</html>