qrcode/main.js
Sven Seeberg d90c3eb092
Replace qrcode module
* Use npm to install qrcode npm module
* Use Browserify to create wrapped bundle
2022-01-08 18:36:40 +01:00

18 lines
350 B
JavaScript

var QRCode = require('qrcode');
class QRCodeWrapper {
constructor(canvas, inputText) {
this.canvas = canvas;
this.inputText = inputText;
}
render() {
QRCode.toCanvas(this.canvas, this.inputText, function (error) {
if (error) console.error(error)
console.log('success!');
});
}
}
module.exports = QRCodeWrapper;