Skip to content

Instantly share code, notes, and snippets.

@9kopb
Created September 23, 2023 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 9kopb/de04c9aa9f96aa52c50bda7c13e8b877 to your computer and use it in GitHub Desktop.
Save 9kopb/de04c9aa9f96aa52c50bda7c13e8b877 to your computer and use it in GitHub Desktop.
wvRypVP
<div id="app">
<qrcode-stream @detect="onDetect" @error="onError"></qrcode-stream>
</div>
const { createApp, ref } = Vue
Vue.createApp({
setup() {
const message = ref('Hello vue!')
return {
message
}
},
methods: {
onDetect(detectedCodes) {
console.log(detectedCodes)
},
onError(error) {
console.error(error)
}
}
}).mount('#app')
<script src="https://unpkg.com/vue@3.3.4/dist/vue.global.js"></script>
<script src="https://unpkg.com/vue-qrcode-reader@5.3.0/dist/vue-qrcode-reader.umd.cjs"></script>
#app {
width: 600px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment