2024-07-12
한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina
Effect picture:
Step 1: Download the corresponding package and build it (Tools---》Build npm)
npm install weapp-qrcode --save
Step 2: Declare in wxml pagecanvas
<canvas style="width: 200px; height: 200px;margin:0 auto;" canvas-id="myQrcode"></canvas>
Step 3: Start referencing in the js file
import drawQrcode from 'weapp-qrcode'
Step 4: Start generating
drawQrcode({ width: 200, height: 200, canvasId: 'myQrcode', text: 'https://www.baidu.com/' })text: is the generated content