How to use the qrcode.CorrectLevel function in qrcode

To help you get started, we’ve selected a few qrcode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gdong42 / ember-qrcode-shim / addon / components / qr-code.js View on Github external
didInsertElement: function() {
    const text = this.get('text');
    const elementId = this.get('elementId');
    const correctLevel = this.get('correctLevel');
    const colorLight = this.get('colorLight');
    const colorDark = this.get('colorDark');
    const width = this.get('width');
    const height = this.get('height');
    
    let qrcode = new QRCode(elementId, {
      text,
      width,
      height,
      colorDark,
      colorLight,
      correctLevel: QRCode.CorrectLevel[correctLevel],
    });
    this.set('qrcode', qrcode);
  },
github cliqz-oss / browser-core / modules / pairing / sources / content / ui.es View on Github external
renderPairing({ pairingToken }) {
    const token = pairingToken;
    if (token) {
      if (!this.qr) {
        this.qr = new QRCode($('#qrcode')[0], {
          text: token,
          width: 256,
          height: 256,
          colorDark: '#000000',
          colorLight: '#ffffff',
          correctLevel: QRCode.CorrectLevel.Q,
        });
        $('<div class="icon-logo"></div>').insertAfter('#qrcode &gt; canvas');
      } else {
        this.qr.makeCode(token);
      }
    }
  }