微信小程序生成二維碼插件


原本的qrcodejs在小程序上運行不了,因此對其進行了修改,並且刪去了不適用的代碼。

下載地址

使用方法如下:

wxml

<canvas canvas-id="canvas" style="width: 300px; height: 300px"></canvas>

js

 1 var qrcode = new QRCode('canvas', {
 2     text: 'http://jindo.dev.naver.com/collie',
 3     width: 300,
 4     height: 300,
 5     colorDark : '#000000',
 6     colorLight : '#ffffff',
 7     correctLevel : QRCode.correctLevel.H
 8 });
 9 
10 qrcode.clear(); // clear the code.
11 qrcode.makeCode('http://naver.com'); // make another code.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM