Use qrcodejs2 plug
1. Install qrcodejs2 : npm install qrcodejs2 --save
2. In the assembly which is introduced: import QRCode from 'qrcodejs2'
3. 在HTML加入:<div id="qrcode" ref="qrcode"></div>
4. Method:
qrcode () { the let QRCode qrcode new new = ( 'qrcode', { width: 200 is, // set the width in pixels height: 200, // set the height in pixels text: 'https://www.baidu.com' // set two-dimensional code or a jump address contents }) }
5. Call: the this . Qrcode ()