You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var qr = require('@cheprasov/qrcode');
global.window.qr = qr;
6.execute command browserify main.js -o qrcode.web.js
7.copy file qrcode.web.js where needed, reference it as usual with <script src="~/qrcode.web.js"></script>
8. use it in HTML javascript like:
const qrCanvas = new qr.QRCodeCanvas('some value for QR code');
const qrdataurl= qrCanvas.toDataUrl();
//assuming you have <img id ="imgQR" src="" /> somewhere in your HTML
document.getElementById("imgQR").src=qrdataurl;
Not sure everything is perfect but works for my case...!
Is it possible to use qrcode.js in a HTML page using <script> tag?
I tried this:
<script type="module" src="~/plugins/js-qrcode/qrcode.js"></script>and also this:
<script type="module"> import { QRCodeCanvas } from '../plugins/js-qrcode/qrcode.js'; </script>but always got JS errors...
The text was updated successfully, but these errors were encountered: