qrcode-g7
v1.0.0
Published
一个现代化的二维码Web组件,支持多种样式模板
Downloads
6
Readme
qrcode-g7
一个现代化的二维码 Web 组件,支持多种样式模板。
安装
npm install qrcode-g7使用方法
<!-- 在 HTML 中使用 -->
<script type="module">
import 'qrcode-g7';
</script>
<qrcode-g7
value="https://example.com"
template="default"
level="H"
width="300"
height="300"
></qrcode-g7>属性说明
value: 要生成二维码的内容template: 二维码样式模板,可选值:default、water、star、rect、diamond、hexagon、bar、heart、glitter、fusion、strokelevel: 二维码纠错级别,可选值:L、M、Q、Hwidth: 二维码宽度height: 二维码高度logo: logo图片地址text: 二维码中心文字textColor: 文字颜色textStroke: 文字描边颜色foregroundImage: 前景图片backgroundImage: 背景图片foregroundColor: 前景色backgroundColor: 背景色innerColor: 内部颜色outerColor: 外部颜色gradientDirection: 渐变方向,可选值:top、bottom、left、right
示例
<!-- 基础用法 -->
<qrcode-g7 value="https://example.com"></qrcode-g7>
<!-- 使用模板 -->
<qrcode-g7
value="https://example.com"
template="water"
foregroundColor="#ff0000"
></qrcode-g7>
<!-- 添加 Logo -->
<qrcode-g7
value="https://example.com"
logo="path/to/logo.png"
></qrcode-g7>License
MIT
