diff --git a/README.md b/README.md index 67346ca..caaff1e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -Taro Code -========= +# Taro Code > QRCode & Barcode component for [Taro.js](https://taro.js.org), inspired by [wx-mini-qrcode](https://github.com/flyingsouthwind/wx-mini-qrcode) and [wxbarcode](https://github.com/alsey/wxbarcode). @@ -20,11 +19,17 @@ import Taro from '@tarojs/taro' import { Barcode, QRCode } from 'taro-code' class Code extends Taro.Component { - render () { + render() { return ( - - + + ) } @@ -37,27 +42,47 @@ class Code extends Taro.Component { #### text -* Type: `string` -* Default: `''` +- Type: `string` +- Default: `''` #### width -* Type: `number` -* Default: `375` +- Type: `number` +- Default: `375` #### height -* Type: `number` -* Default: `80` +- Type: `number` +- Default: `80` + +#### scale + +- Type: `number` +- Default: `4` ### QRCode #### text -* Type: `string` -* Default: `''` +- Type: `string` +- Default: `''` #### size -* Type: `number` -* Default: `300` +- Type: `number` +- Default: `300` + +#### scale + +- Type: `number` +- Default: `4` + +#### typeNumber + +- Type: `number` +- Default: `2` + +#### errorCorrectLevel + +- Type: `string` +- Default: `'M'` diff --git a/src/components/Qrcode/index.js b/src/components/Qrcode/index.js index 1216798..f3f8e06 100644 --- a/src/components/Qrcode/index.js +++ b/src/components/Qrcode/index.js @@ -22,7 +22,7 @@ function QRCode({ text, size, scale, typeNumber, errorCorrectLevel }) { QRCode.defaultProps = { text: '', size: 100, - scale: 3, + scale: 4, errorCorrectLevel: 'M', typeNumber: 2, }