Showing
1 changed file
with
23 additions
and
0 deletions
README.md
0 → 100644
| 1 | +# react-native-lewin-qrcode | ||
| 2 | +react-native 识别照片二维码 | ||
| 3 | + | ||
| 4 | +## Table of contents | ||
| 5 | +- [Install](#install) | ||
| 6 | +- [Usage](#usage) | ||
| 7 | + | ||
| 8 | +## Install | ||
| 9 | +### 1: 暂时没有发布到npm所以需要自己手动添加到dependencies | ||
| 10 | +`"react-native-lewin-qrcode": "git://github.com/LewinJun/react-native-lewin-qrcode.git#1.0"` | ||
| 11 | +### 2: yarn install 或 npm install | ||
| 12 | +### 3: react-native link react-native-lewin-qrcode | ||
| 13 | + | ||
| 14 | +## Usage | ||
| 15 | +```javascript | ||
| 16 | +import {readerQR} from 'react-native-lewin-qrcode' | ||
| 17 | + //path 图片文件的路径 | ||
| 18 | + readerQR(path).then((data)=>{ | ||
| 19 | + Alert.alert('识别结果',data); | ||
| 20 | + }).catch((err)=>{ | ||
| 21 | + Alert.alert('识别失败'); | ||
| 22 | + }); | ||
| 23 | +```javascript |
-
Please register or login to post a comment