ember-qrcode-shim
v0.4.0
Published
An ember wrapper of qrcode.js
Downloads
10,497
Readme
Ember-qrcode-shim
An ember wrapper of qrcode.js, a tool to generate QR Code on client side.
Installation
ember install ember-qrcode-shim
Linting
npm run lint:js
npm run lint:js -- --fix
Running tests
ember test
– Runs the test suite on the current Ember versionember test --server
– Runs the test suite in "watch mode"ember try:each
– Runs the test suite against multiple Ember versions
Running the dummy application
ember serve
- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
Usage
As qr-code
Component
Example
{{qr-code text="http://www.example.com" colorLight="#F7F7F7" width=155 height=155 correctLevel="L"}}
Config arguments provided by qrcode.js are also provided as component attributes with same key names. They are
text
- the target text that the QR code represents forwidth
- the QR image widthheight
- the QR image heightcolorDark
- color of dark blockscolorLight
- color of light backgroundcorrectLevel
- L | M | Q | H
As ES6 module
You can also import qrcode.js as an ES6 module, so that you can have full control of rendering the QR Code as you wish.
import QRCode from 'qrcode';
...
This project is licensed under the MIT License.