前端生成二维码qrcode.js

362 阅读1分钟

前端生成二维码插件 qrcode.js 的使用

  • 引入 qrcode.js
qrcode(){
    var url = window.location.href;
    var qrcode = new QRCode(document.getElementById("share-code"), {
        width : 100,//这个值关于二维码的清晰度
        height : 100//这个值关于二维码的清晰度
    });
    qrcode.makeCode(url);
    console.log('二维码链接',url)
}