Skip to content

Commit

Permalink
fix(qrcode): qrcode not displayed properly
Browse files Browse the repository at this point in the history
fixed: #1026
  • Loading branch information
mynetfan committed Aug 3, 2021
1 parent 1214b7c commit 26f251e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/Qrcode/src/Qrcode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</div>
</template>
<script lang="ts">
import { defineComponent, watch, PropType, ref, unref } from 'vue';
import { defineComponent, watch, PropType, ref, unref, onMounted } from 'vue';
import { toCanvas, QRCodeRenderersOptions, LogoType } from './qrcodePlus';
import { toDataURL } from 'qrcode';
import { downloadByUrl } from '/@/utils/file/download';
Expand Down Expand Up @@ -93,16 +93,18 @@
});
}
onMounted(createQrcode);
// 监听参数变化重新生成二维码
watch(
props,
() => {
createQrcode()
createQrcode();
},
{
deep: true,
}
)
);
return { wrapRef, download };
},
Expand Down

0 comments on commit 26f251e

Please sign in to comment.