Explorar o código

Merge branch 'master' of qk:zhuishuyun/precise_delivery_distribution_front

xia %!s(int64=4) %!d(string=hai) anos
pai
achega
276c1ce6f1
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/plugins/vue-qrcode.ts

+ 2 - 0
src/plugins/vue-qrcode.ts

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