安裝依賴
npm install qrcode.react --save
使用
import QRCode from 'qrcode.react';
<QRCode
value={}? // value參數(shù)為生成二維碼的鏈接? ? ? ? ? ? ? ? ? ? ? ? ? ? size={150}? // 二維碼的寬高尺寸? ? ? ? ? ? ? ? ? ? ? ? fgColor="#000000"? // 二維碼的顏色? ? ? ? ? ? ? imageSettings={{ //二維碼中設置圖片? ? ? ? ? ? ? ? ? ? src:require('../../Home/images/codelogo.png'),? ? ? ? ? ? ? ?
height:35,? ? ? ? ? ? ?
width:40,? ? ? ? ? ? ? ? ? ?
excavate:false? ? ? ? ? ? ? ? ? ? ? ?
? }}? ? ? ? ? ? ? ? ? ? ?
? />