Files
web_huangguo2_h5/app/static/js/common/qr.js
T
谢宇宁andClaude Opus 5.5 0fbdba5ccf Initial commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 11:47:47 +07:00

23 lines
565 B
JavaScript

(function () {
if (typeof QRCode === "undefined") return;
var nodes = document.querySelectorAll("[data-qr]");
Array.prototype.forEach.call(nodes, function (el) {
var text = (el.getAttribute("data-qr") || "").trim();
if (!text) return;
el.innerHTML = "";
try {
new QRCode(el, {
text: text,
width: 96,
height: 96,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.M,
});
} catch (err) {
// ignore render errors; keep empty box
}
});
})();