0.0.3 • Published 2 years ago
scan-qr-svelte v0.0.3
Installation
npm install scan-qr-svelte
# create a new project in my-app
yarn add scan-qr-svelte
How to use
If you want to use result value from QRCODE you need to have variable to store result
<script>
import ScanQrCode from '$lib/ScanQRCode.svelte';
</script>
<ScanQrCode
on:scanresult={(e) => {
console.log(e.detail.result);
}}
/>
<script>
import ScanQrCode from '$lib/ScanQRCode.svelte';
var res;
</script>
<ScanQrCode
on:scanresult={(e) => {
res = e.detail.result;
}}
/>
<input bind:value={res} />