0.0.3 • Published 4 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-svelteHow 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} />