@xiangheng08/qrcode
v0.0.2
Published
一个基于 Web Components 的轻量级二维码生成器,支持纠错码功能。
Downloads
15
Maintainers
Readme
@xiangheng08/qrcode
简介
一个基于 Web Components 的轻量级二维码生成器,支持纠错码功能。
功能特性
- 生成标准二维码
- 支持纠错码级别 (L/M/Q/H)
- 可配置二维码版本 (1-40)
- 可自定义像素大小和颜色
- 支持添加Logo
- 支持遮罩层
- 基于 Lit 的 Web Components 实现
- 支持群二维码(xh-group-qrcode)
- 支持个人名片二维码(xh-vcard-qrcode)
开发文档
使用方法
标准二维码
<xh-qrcode
value="hello world!"
version="5"
errorcorrectionlevel="M"
pixelsize="10"
color="#000"
background="#fff"
logo="logo.png"
logoscale="0.2"
logopadding="0.1"
mask
>
</xh-qrcode>群二维码
<xh-group-qrcode
value="群聊邀请链接"
width="400"
groupavatarmode="grid"
groupavatar="group-avatar.jpg"
groupname="技术交流群"
tips="扫描二维码加入群聊"
>
</xh-group-qrcode>个人名片二维码
<xh-vcard-qrcode
value="联系方式"
width="400"
avatar="avatar.jpg"
name="张三"
description="前端工程师"
tips="扫描二维码查看联系方式"
>
</xh-vcard-qrcode>构建
npm run build开发
npm run dev来源声明
代码来源
lib/core 目录下的代码来源于 node-qrcode(获取时的提交版本),由 lingma 转换为 TypeScript 并将其中的注释翻译为中文。
The code in the lib/core directory originates from node-qrcode (commit at the time of acquisition), converted to TypeScript and translated comments into Chinese by lingma.
Avatars
src/assets/avatars、docs/public/images/avatars 目录下的头像来源于头像库。
src/assets/avatars、docs/public/images/avatars 目录下的头像仅用于学习/展示,本项目不将其用于商业用途。其他使用者请注意:从本仓库获取的这些头像请勿随意使用,若因此造成任何法律风险与本项目和本项目作者无关。
