# j-QRCode

> Acest element creează un cod QR. [Bibliotecă QRC](https://davidshimjs.github.io/qrcodejs/).

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

Acest element creează un cod QR. [Bibliotecă QRC](https://davidshimjs.github.io/qrcodejs/).


__Configurarea__:

- `width {Number}` o lățime de imagine standard (default: `128`)
- `height {Number}` Înălțimea imaginii (default) `128`)
- `fg {String}` o culoare de bază (default: `#000000`)
- `bg {String}` o culoare de fundal (default: `#FFFFFF`)
- `delay {Number}` o întârziere mică pentru generarea de cod (default: `200`)

__Cum se produce codul 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);
```

Utilizați-l cu `<ui-component name="qrcode">`Când componenta nu este încă încărcată, jComponent Descărcați-l la prima utilizare de la adresa `DEF.fallback` (în cazul Componentator Autor: Peter Širka. sursă: Componentator Componente de stocare, MIT licență.

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