| 参数 | 类型 | 默认值 | 描述 |
background | String | "white" | 二维码的背景颜色。 |
foreground | String | "black" | 二维码的前景颜色。 |
level | String | "L" | 二维码的误差校正级别(L, M, Q, H)。 |
mime | String | "image/png" | 二维码输出为图片时的MIME类型。 |
size | Number | 100 | 二维码的尺寸,单位像素。 |
value | String | "请求URL" | 需要编码为二维码的值 |
| <html> <head> <title> 二维码 </title> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/> <script src="qrious.min.js"></script> </head> <body> <img id="qrious"/> <script type="text/javascript"> var qr = new QRious({ element : document.getElementById("qrious"), size : 200, level : 'H', value : 'https://www.baidu.com' }); </script> </body> </html> |
| 欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |