当前位置:网站首页>Generate detailed API and parameters of QR code using qrcodejs2
Generate detailed API and parameters of QR code using qrcodejs2
2022-06-22 22:32:00 【_ Baby grut】
Use qrcodejs2 Generate qr code
install qrcodejs2
cnpm install qrcodejs2 --saveUse qrcodejs2
The page introduce
import QRCode from 'qrcodejs2'Page TAB
<div id="qrcode" ref="qrcode"></div>You can make ⽤ id perhaps ref, It is suggested that ⽤ ref, Because ⽤ vue Frame control virtual Dom The right choice is simple ⽅ then
createQRcode(WIDTH, id, text) {
let long = document.documentElement.clientWidth * (WIDTH / 375)
new QRCode(id, {
width: long,
height: long,
text: text,
correctLevel : QRCode.CorrectLevel.L
});
// correctLevel Fault tolerance level , Can be set to :
// QRCode.CorrectLevel.L
// QRCode.CorrectLevel.M
// QRCode.CorrectLevel.Q
// QRCode.CorrectLevel.H
// L - M - Q - H The code density is getting higher and higher , Default not set yes H
},
// this.createQRcode(132, `qrcode`, `${this.DOMAIN}`);Parameter description
new QRCode(element, option)| name | The default value is | explain |
|---|---|---|
| element | - | Displays the element of the QR code or the name of the element ID |
| option | Parameter configuration |
Options
| name | The default value is | explain |
|---|---|---|
| width | 256 | The width of the image |
| height | 256 | Height of the image |
| typeNumber | 4 | |
| colorDark | "#000000" | The foreground |
| colorLight | "#ffffff" | Background color |
| correctLevel | QRCode.CorrectLevel.L | Fault tolerance level , Can be set to : QRCode.CorrectLevel.L QRCode.CorrectLevel.M QRCode.CorrectLevel.Q QRCode.CorrectLevel.H The density of generated codes from top to bottom is getting higher and higher L - M - Q - H |
Events
| name | explain |
|---|---|
| makeCode(text) | Set QR code content |
| clear() | Clear QR code .( Only if it doesn't support Canvas It works under the browser of ) |
resources
边栏推荐
- [GWCTF 2019]mypassword XSS
- Ten thousand words long text | use RBAC to restrict access to kubernetes resources
- 6月PMP考试准考证问题及注意事项,考生必读
- June 25 PMI certification examination site epidemic prevention requirements and examination room arrangement
- 2022年朝阳区科技创新课之“产品创新与成果转化”训练营活动圆满结束
- Cryptography series: certificate format representation of PKI X.509
- SPA项目开发之登录注册
- 【MAVROS】MAVROS 啓動指南
- RealNetworks vs. Microsoft: the battle in the early streaming media industry
- Reasons for the failure of digital transformation and the way to success
猜你喜欢

LinkedList 源码解析

大不列颠泰迪熊加入PUBG 手游

CYCA少儿形体礼仪 深圳市培训成果考核圆满落幕
A hundred lines of code to realize reliable delay queue based on redis

Summary of just meal with 900W increase in playback and acclaim from station B users

SPA项目开发之CRUD+表单验证

二级造价工程师考前必备15个知识点来了!祝你旗开得胜!

SPA项目开发之动态树+数据表格+分页

The necessary materials for the soft test have been released. All the soft test materials for the whole subject have been prepared for you!

6-3 二叉树的非递归遍历
随机推荐
The xinjietu x70s has been listed for 87900 times and has leapfrogged the class in space safety. It is worthy of being a 7-seat SUV of the National University of China
Developing salary management system based on C language course paper + source code and executable EXE file
Note: by the end of 2022, the printing entrance of Guangdong second-class cost engineer's admission card has been opened
Pycharm configuring remote connection server development environment
新捷途X70S上市8.79万起,空间安全越级,不愧是网红国民大7座SUV
自助圖書館系統-Tkinter界面和openpyxl錶格綜合設計案例
[mavros] mavros startup Guide
June 25 PMI certification examination site epidemic prevention requirements and examination room arrangement
Redis-分布式锁
Based on AI driven macromolecular drug discovery, "Huashen Zhiyao" obtained nearly 500million yuan of round a financing
sitl_ gazebo/include/gazebo_ opticalflow_ plugin. h:43:18: error: ‘TRUE’ was not declared in this scope
[Li mu] how to read papers [intensive reading of papers]
There are 15 necessary knowledge points for the second level cost engineer before the exam! I wish you success!
6月PMP考试准考证问题及注意事项,考生必读
Fundamentals of shell programming (Part 7: branch statement -if)
322. change exchange
KDD'22 | 阿里: 基于EE探索的精排CTR预估
6-1 operation set of binary search tree
Uniapp applet mall develops thinkphp6 points mall, group purchase and seckill packaged app
Makefile:1860: recipe for target ‘cmake_check_build_system‘ failed make: *** [cmake_check_build_syst
https://www.npmjs.com/package/qrcodejs2