生成二维码

用到的js:

jquery, jquery.qrcode.min.js <!-- 二维码根节点 -->             <div style="display: none;">                 <div id="canvasCode"></div>             </div> 调用 mounted() {                this.getQRCanvasCode()             },   //生成分享二维码                 getQRCanvasCode() {                     const qr = 'http://h5.tuku628.com/sq/helper/helper'                     const qrcode = $("#canvasCode")                     .qrcode({                         render: "canvas", //也可以替换为table                         width: 120,                         height: 120,                         text: qr,                         /*可以通过ajax请求动态设置*/                     })                     console.log(qrcode[0])                     let qrcode_canvas = qrcode.find("canvas").get(0);                     console.log(qrcode_canvas)                     this.qrcodeImg = qrcode_canvas.toDataURL("image/jpg") //二维码base64图片                 },
上一篇:SpringBoot系列(十四)集成邮件发送服务及邮件发送的几种方式


下一篇:剑指 Offer 27. 二叉树的镜像