千峰商城-springboot项目搭建-81-订单提交及支付-qrcode生成二维码
作者:互联网
1.导入两个jar包
2.代码:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <div style="width: 220px; height: 220px; background: lawngreen;"> <div id="qrcodeDiv" style="width: 200px; height: 200px; margin: 10px;"></div> </div> <script type="text/javascript" src="js/jquery-3.4.1.min.js" ></script> <script type="text/javascript" src="js/qrcode.min.js" ></script> <script type="text/javascript"> var str = "我是小白白"; var qrcode = new QRCode( $("#qrcodeDiv")[0] ,{ width:180, height:180 }); qrcode.makeCode(str); </script> </body> </html>
3.打开页面,成功生成二维码:(我是小白白)
标签:springboot,白白,二维码,var,180,str,qrcode,81 来源: https://www.cnblogs.com/lysboke/p/16536825.html