简单二维码使用
Q1:需要导入到包(需要联系我)
Q2:html(NewFile)
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <textarea id="txtContent" cols="50" rows="5"></textarea> <button type="button" onclick="getCode();">生成</button> <div id="qrCode"></div> <script src="js/jqQrcode/qrcode.min.js" type="text/javascript" charset="utf-8"></script> <script> var qrCode = document.getElementById("qrCode"); var txtContent = document.getElementById("txtContent"); var qrcode=new QRCode(qrCode,{ width:300, height:300, correctLevel:QRCode.CorrectLevel.L }); function getCode() { qrcode.makeCode(txtContent.value); } </script> </body> </html>
结果
二维码中数据越多,二维码就越复杂
zywds