2.2.0 • Published 4 years ago

taro3-code v2.2.0

Weekly downloads
48
License
MIT
Repository
-
Last release
4 years ago

Taro Code

QRCode & Barcode component for Taro.js, inspired by wx-base64-qrcode and wxbarcode. Components will generate base64 qrcode/barcode image.

Getting Started

Install

yarn add taro3-code
# or
npm install taro3-code

Usage

import React from 'react'
import { Barcode, QRCode } from 'taro3-code'

class Code extends React.Component {
  render() {
    return (
      <View>
        <Barcode text='hello' width={300} height={60} scale={4} />
        <QRCode
          text='world'
          size={300}
          scale={4}
          errorCorrectLevel='M'
          typeNumber={2}
        />
      </View>
    )
  }
}

Props

Barcode

PropTypeDefault
textstring''
widthnumber300
heightnumber80
scalenumber4

QRCode

PropTypeDefault
textstring''
sizenumber300
scalenumber4
typeNumbernumber2
errorCorrectLevelstring'M'