j-QRCode
Questo componente crea un codice QR. Libreria di QRC.
Configurazione:
width {Number}una larghezza immagine predefinita (predefinito:128)height {Number}: altezza immagine predefinita (predefinito128)fg {String}un colore di sfondo (default:#000000)bg {String}un colore di sfondo (default:#FFFFFF)delay {Number}un piccolo ritardo per la generazione di codice (default:200)
Come creare un codice QR?
var opt = {};
opt.text = 'https://www.totaljs.com';
// opt.width {Number}
// opt.height {Number}
// opt.fg {String}
// opt.bg {String}
opt.callback = function(base64) {
console.log(base64);
};
SETTER('qrcode/create', opt);Utilizzare con <ui-component name="qrcode">Quando il componente non è ancora caricato, jComponent Scarica il codice in prima utilizzazione dall'indirizzo DEF.fallback (Il Componentator La storia di Peter Širka.Fonte: il Componentator Ristorante dei componenti, licenza MIT.
<ui-component name="qrcode" config="width:200;height:200"></ui-component>
<script>
ON('ready', function() {
var opt = {};
opt.text = 'https://totaljs.com';
opt.callback = function(base64) {
var img = document.createElement('IMG');
img.setAttribute('src', base64);
document.body.append(img);
};
SETTER('qrcode/create', opt);
});
</script>