question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how can i use it for scan normal barcode not qr

See original GitHub issue

hi i have this code `<html lang="en">

<head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>HTML5 QR Code with Vue js</title> <link rel="stylesheet" href="style.css"> </head> <body> <div id="app"> <div class="header" style="margin-bottom: 20px;">{{ header }}</div> <div class="section" style="width: 500px; margin: auto;"> <qrcode-scanner v-bind:qrbox="250" v-bind:fps="10" style="width: 500px;"> </qrcode-scanner>
    </div>
    
    <div class="footer" style="margin-bottom: 20px;">{{ result }}</div>
</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://unpkg.com/html5-qrcode"></script>
<script>
    Vue.component('qrcode-scanner', {
        props: {
            qrbox: Number,
            fps: Number,
        },
        template: `<div id="qr-code-full-region"></div>`,
        mounted: function () {
            var $this = this;
            var config = { fps: this.fps ? this.fps : 10 };
            if (this.qrbox) {
                config['qrbox'] = this.qrbox;
            }

            function onScanSuccess(decodedText, decodedResult) {
                $this.$root.$emit('decodedCode', decodedText, decodedResult);
            }

            var html5QrcodeScanner = new Html5QrcodeScanner(
                "qr-code-full-region", config);
            html5QrcodeScanner.render(onScanSuccess);
        }
    });

    var app = new Vue({
        el: '#app',
        data: {
            header: 'Html5-qrcode using vue.js',
            result: ''
        },
        created: function () {
            this.$root.$on('decodedCode', function (decodedText, decodedResult) {
                alert(decodedText);
                this.decodedText = decodedText;
            }.bind(this));
        }
    });
</script>
</body> </html> `

its working great but only with qr how can i change the type for ean 13 or anything else thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bluepuma77commented, Feb 15, 2022

Usually the library scans all codes, you can limit it to certain code types. Make sure your scanning div is not too small.

1reaction
amitnjhacommented, Feb 14, 2022

Have you tried demo app yet? https://scanapp.org/#reader It scans barcodes without any issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to scan a QR code on your Android (no apps required)
Use your Android's camera app · Open your camera app, point it at a QR code and hold steady for a few seconds....
Read more >
9 reasons Why Your QR Code is Not Working - Beaconstac blog
If the QR Code is still not working, try scanning it via an external QR Code scanner or update your operating system to...
Read more >
How to Scan Barcodes With an Android Phone Using Barcode ...
1. Open the Play Store on your device. You can find the Play Store in your list of apps. The icon looks like...
Read more >
How to scan a QR code with your iPhone or Android phone
Your Android phone's camera likely can scan QR codes without the use of a third-party app. Here's how: ... Open the Camera app...
Read more >
Guide to Barcodes vs. QR Codes: Analysis and Comparison
QR codes may be considered easier to scan compared to 1D barcodes, as they can be scanned in any direction, whereas 1D barcodes...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found