Commit ccc5aa81 authored by 王玉鑫's avatar 王玉鑫

fix: 详情页二维码为空报错修正

parent 620c4ac3
......@@ -20,17 +20,19 @@ const props = withDefaults(
const canvasRef = ref<HTMLCanvasElement>();
onMounted(() => {
QRCode.toCanvas(
canvasRef.value,
props.content,
{
width: 68,
margin: 0,
},
(error) => {
if (error) console.error(error);
console.log('success!');
},
);
if (props.content) {
QRCode.toCanvas(
canvasRef.value,
props.content,
{
width: 68,
margin: 0,
},
(error) => {
if (error) console.error(error);
console.log('success!');
},
);
}
});
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment