0.0.2 • Published 5 years ago

ac-qrcodes v0.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

ac-qrcode

二维码组件

image

npm version NPM downloads

在线演示:https://tinper-acs.github.io/ac-qrcode/

代码演示

1. 简介

React二维码组件,使用底层核心算法qr.js进行组件封装,提供标准的功能展示,具有Level、前景、背景颜色设置、大小设置、边框间距设置、SVG和Canvas格式等

2. 安装

  1. 通过npm安装
    npm install ac-qrcodes --save
  2. 国内镜像通过cnpm安装
    cnpm install ac-qrcodes --save
  3. 用友内网通过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

参数类型默认值
valuestring
renderAsstring ('canvas' 'svg')'canvas'
sizenumber128
bgColorstring (CSS color)"#FFFFFF"
fgColorstring (CSS color)"#000000"
levelstring ('L' 'M' 'Q' 'H')'L'
includeMarginbooleanfalse

5. CHANGLOG