ac-qrcode
二维码组件
![image](https://user-images.githubusercontent.com/3817644/53713600-5f7bcf00-3e86-11e9-8dfd-399b442029c6.png)
![NPM downloads](http://img.shields.io/npm/dt/ac-qrcodes.svg?style=flat)
在线演示:https://tinper-acs.github.io/ac-qrcode/
代码演示
1. 简介
React二维码组件,使用底层核心算法qr.js进行组件封装,提供标准的功能展示,具有Level、前景、背景颜色设置、大小设置、边框间距设置、SVG和Canvas格式等
2. 安装
- 通过
npm
安装
npm install ac-qrcodes --save
- 国内镜像通过
cnpm
安装
cnpm install ac-qrcodes --save
- 用友内网通过
ynpm
安装
ynpm install ac-qrcodes --save
3. 使用
import AcQrcode from "ac-qrcodes";
render(){
return (<div>
<AcQrcode
value={"http://tinper.org/"}
size={128}
bgColor={"#ffffff"}
fgColor={"#000000"}
level={"L"}
includeMargin={false}
renderAs={"svg"}
/>
</div>)
}
4. API
参数 | 类型 | 默认值 |
---|
value | string | |
renderAs | string ('canvas' 'svg') | 'canvas' |
size | number | 128 |
bgColor | string (CSS color) | "#FFFFFF" |
fgColor | string (CSS color) | "#000000" |
level | string ('L' 'M' 'Q' 'H') | 'L' |
includeMargin | boolean | false |
5. CHANGLOG