mirror of
https://github.com/hanzo-labs/arcadia.git
synced 2026-10-30 18:55:41 +00:00
23 lines
579 B
JavaScript
23 lines
579 B
JavaScript
'use strict';
|
|
var QRCodeDrtv = function() {
|
|
return function(scope, element, attrs) {
|
|
var watchVar = attrs.watchVar;
|
|
scope.$watch(watchVar, function() {
|
|
var value = attrs.qrCode;
|
|
element.empty();
|
|
var delay = 0;
|
|
if (element[0].clientWidth == 0) delay = 200;
|
|
setTimeout(function() {
|
|
new QRCode(element[0], {
|
|
text: value,
|
|
width: element[0].clientWidth,
|
|
height: element[0].clientWidth,
|
|
colorDark: "#000000",
|
|
colorLight: "#ffffff",
|
|
correctLevel: QRCode.CorrectLevel.M
|
|
});
|
|
}, delay);
|
|
});
|
|
};
|
|
};
|
|
module.exports = QRCodeDrtv; |