# j-QRCode

> Diese Komponente erstellt einen QR-Code. Es enthält die [QRCode-Bibliothek](https://davidshimjs.github.io/qrcodejs/).

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

Diese Komponente erstellt einen QR-Code. Es enthält die [QRCode-Bibliothek](https://davidshimjs.github.io/qrcodejs/).


__Konfiguration__:

- `width {Number}` eine Standardbildbreite (Standard: `128`)
- `height {Number}` eine Standardbildhöhe (Standard: `128`)
- `fg {String}` eine Vordergrundfarbe (Standard: `#000000`)
- `bg {String}` eine Hintergrundfarbe (Standard: `#FFFFFF`)
- `delay {Number}` eine kleine Verzögerung bei der Codegenerierung (Standard: `200`)

__Wie erstelle ich einen QR-Code?__

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

Verwenden Sie es mit `<ui-component name="qrcode">`. Wenn die Komponente noch nicht geladen ist, lädt jComponent sie bei der ersten Verwendung von der Adresse in `DEF.fallback` herunter (standardmäßig das CDN Componentator). Autor: Peter Širka. Quelle: Componentator-Komponenten-Repository, MIT-Lizenz.

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