qrLogoCode是轻量级二维码生成器,基于原生js,支持logo嵌入
无
QrCodeWithLogo.toCanvas({
canvas: document.getElementById('canvas'),
content: 'https://www.baidu.com',
width: document.documentElement.clientWidth / 3 * 2,
})
QrCodeWithLogo.toCanvas({
canvas: document.getElementById('canvas1'),
content: 'https://www.baidu.com',
width: document.documentElement.clientWidth / 3 * 2,
logo: {
src: './img/head1.jpg'
}
})
QrCodeWithLogo.toCanvas({
canvas: document.getElementById('canvas2'),
content: 'https://www.baidu.com',
width: document.documentElement.clientWidth / 3 * 2,
logo: {
src: './img/head2.jpg',
logoSize: 0.2,
borderSize: 0
}
})
QrCodeWithLogo.toCanvas({
canvas: document.getElementById('canvas3'),
content: 'https://www.baidu.com',
width: document.documentElement.clientWidth / 3 * 2,
logo: {
src: './img/head4.jpg',
logoSize: 0.22
}
})
更多配置和用法,请参考qr-code-with-logo