Sfoglia il codice sorgente

Merge branch 'master' of qk:zhuishuyun/precise_delivery_distribution_front

xia 4 anni fa
parent
commit
276c1ce6f1
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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);