|
@@ -20,6 +20,7 @@ const bind = async (
|
|
) => {
|
|
) => {
|
|
console.log("mounted:", binding);
|
|
console.log("mounted:", binding);
|
|
const qrText = binding.value;
|
|
const qrText = binding.value;
|
|
|
|
+ if (!qrText) return;
|
|
if (typeof qrText === "string") {
|
|
if (typeof qrText === "string") {
|
|
const code = await QRCode.toDataURL(qrText);
|
|
const code = await QRCode.toDataURL(qrText);
|
|
insertQrCode2Element(el, code);
|
|
insertQrCode2Element(el, code);
|
|
@@ -30,6 +31,7 @@ const update = async (el: HTMLElement | Element, binding: DirectiveBinding) => {
|
|
if (binding.oldValue === binding.value) return;
|
|
if (binding.oldValue === binding.value) return;
|
|
console.log("update:", binding);
|
|
console.log("update:", binding);
|
|
const qrText = binding.value;
|
|
const qrText = binding.value;
|
|
|
|
+ if (!qrText) return;
|
|
if (typeof qrText === "string") {
|
|
if (typeof qrText === "string") {
|
|
const code = await QRCode.toDataURL(qrText);
|
|
const code = await QRCode.toDataURL(qrText);
|
|
insertQrCode2Element(el, code);
|
|
insertQrCode2Element(el, code);
|