安装qrcode
npminstallqrcode-s
使用
1.在你需要的文件中引入:

2.定义一个canvas:

3.定义一个方法:

useqrcode(){letcanvas=document.getElementById("canvas");QRCode.toCanvas(canvas,`https://mjuruankai.com/#/article/${this.id}`,{toSJISFunc:QRCode.toSJIS},function(error){if(error)console.error(error);console.log("success!");});}
4.在某个时期调用,我是在获取文章后:
