[Vuejs]-Vue 3 – input type=file does not read QR code. Which are the alternatives?

0👍

You should use Javascript to access the camera as a Webcam. This would allow you to process the video stream in JS. There are libraries such as QR Scanner that provide ways to scan QR codes. They provide some example code in their readme :

<video id="webcam"></video>
<script src="path/to/qr-scanner.umd.min.js"></script>
<script>
    const videoElem = document.getElementById("webcam");
    const qrScanner = new QrScanner(
        videoElem,
        result => console.log('decoded qr code:', result),
        { /* your options or returnDetailedScanResult: true if you're not specifying any other options */ },
    );
</script>

Leave a comment