y-qrcode
v1.0.1
Published
二维码生成器,含中心icon和二维码背景等
Downloads
5
Readme
用法
<div ref="qrCode" id="qrcode" ></div>
import QRCode from "y-qrcode";
var qrcode = new QRCode(document.getElementById("qrcode"), {
text: 'your content',
width: 256,
height: 256,
colorDark : '#000000',
colorLight : '#ffffff',
/*!
容错级别,可设置为:
QRCode.CorrectLevel.L
QRCode.CorrectLevel.M
QRCode.CorrectLevel.Q
QRCode.CorrectLevel.H
*/
correctLevel : QRCode.CorrectLevel.L,
iconSrc: "http://www.365mini.com/static/image/cry.gif",
iconRadius: 10,
iconBorderWidth: 5,
iconBorderColor: "transparent",
//外围幕布(或画布)的宽度
curtainWidth: 300,
//外围幕布(或画布)的高度
curtainHeight: 300,
//外围幕布(或画布)图片
//curtainImg: "qrcode_border.png",
//外围幕布(或画布)底色
//curtainBgColor: "Wheat",
//二维码相对外围幕布(或画布)的X偏移
qrcodeOffsetX: 88,
//二维码相对外围幕布(或画布)的Y偏移
qrcodeOffsetY: 108,
});
//清空原先的图像,重新做一张
//qrcode.clear();
//qrcode.makeCode('new content');