当前位置:网站首页>Generation of barcode and QR code

Generation of barcode and QR code

2022-04-23 16:58:00 Endless cake

Generation of bar code and QR code

Attach document address :https://download.csdn.net/download/weixin_39162041/12272441
These are three js library , When using, you only need to put three files in one directory , Go to the place where you need to generate QR code or bar code , Directly introducing index.js that will do , as follows :

html
 notes : Because the generation uses canvas Generated , So which one to use , Add the generated tag on the page . Design your own style /
      <canvas canvas-id="barcode" class='barcode' />
      <canvas canvas-id="qrcode" class='qrcodes' />
js
// Introduce... On the page where you need to generate QR code index.js
let wxbarcode = require('../../libs/index.js');

 notes : The following array is the width and height of the generated code ,res.data.data For data 
wxbarcode.barcode('barcode', res.data.data, 580, 150);// Generate this barcode 
wxbarcode.qrcode('qrcode', res.data.data, 400, 400);// This is to generate QR code 

版权声明
本文为[Endless cake]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230554520215.html