taro3-code

2.2.0 • Public • Published

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

Prop Type Default
text string ''
width number 300
height number 80
scale number 4

QRCode

Prop Type Default
text string ''
size number 300
scale number 4
typeNumber number 2
errorCorrectLevel string 'M'

Readme

Keywords

none

Package Sidebar

Install

npm i taro3-code

Weekly Downloads

6

Version

2.2.0

License

MIT

Unpacked Size

118 kB

Total Files

18

Last publish

Collaborators

  • slobber