# j-QRCode

> Questo componente crea un codice QR. [Libreria di QRC](https://davidshimjs.github.io/qrcodejs/).

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: it
Content-SHA256: 94fa7e06478aaa75df486423235c1e758b8e68710af88d47ffeba9610f284f8a
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

Questo componente crea un codice QR. [Libreria di QRC](https://davidshimjs.github.io/qrcodejs/).


__Configurazione__:

- `width {Number}` una larghezza immagine predefinita (predefinito: `128`)
- `height {Number}`: altezza immagine predefinita (predefinito `128`)
- `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?__

```js
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.

```html example.html
<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>
```
