WeChat Mini Program QR Code Generation Tool weapp-qrcode Detailed Explanation

WeChat Mini Program QR Code Generation Tool weapp-qrcode Detailed Explanation

WeChat Mini Program - QR Code Generator

Download: weapp-qrcode.js file

github:https://github.com/Pudon/weapp-qrcode-base64

Introduce the weapp-qrcode.js file into the project

js

const app = getApp();
const QR = require('../../lib/weapp-qrcode.js'); // Import weapp-qrcode

Page({
    /**
     * Initial data of the page */
    data: {
        QrCodeURL:'', // QR code image path},
    // QR code drawImg: function (){
        let that = this,
            params = "https://www.baidu.com/"; // QR code parameters var imgData = QR.drawImg(params, {
            typeNumber: 4, // density errorCorrectLevel: 'L', // error correction level size: 800, // white border })
        
        this.setData({
            qrcodeURL: imgData
        })
    },
})

html

<view style="text-align:center;">
    <image style="width:500rpx;height:500rpx;" src="{{ qrcodeURL }}" ></image>
</view>

This is the end of this article about the WeChat Mini Program QR Code Generation Tool weapp-qrcode. For more related WeChat Mini Program QR Code Generation Tool content, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use cloud functions to generate QR codes in WeChat applet cloud development
  • How to generate a sharing poster using WeChat applet (with QR code generation)
  • Sample code for generating QR code in WeChat applet
  • Example of node implementing the function of generating a small program QR code with parameters and saving it locally
  • WeChat applet dynamically generates QR code implementation code
  • How to generate a QR code image from a string in WeChat applet

<<:  Detailed steps for running springboot project in Linux Docker

>>:  The difference and advantages and disadvantages of Mysql primary key UUID and auto-increment primary key

Recommend

Native JS to achieve image marquee effects

Today I will share with you a picture marquee eff...

Summary of solutions for MySQL not supporting group by

I downloaded and installed the latest version of ...

Vue's vue.$set() method source code case detailed explanation

In the process of using Vue to develop projects, ...

In-depth reading and practice records of conditional types in TypeScript

Table of contents Using conditional types in gene...

How to filter out duplicate data when inserting large amounts of data into MySQL

Table of contents 1. Discover the problem 2. Dele...

Bootstrap 3.0 study notes page layout

This time we will mainly learn about layout, whic...

CSS setting div background image implementation code

Adding background image control to a component re...

Detailed explanation of MySQL string concatenation function GROUP_CONCAT

In the previous article, I wrote a cross-table up...

Linux sftp command usage

Concept of SFTP sftp is the abbreviation of Secur...

Vue uses three methods to refresh the page

When we are writing projects, we often encounter ...

HTML special character conversion table

character Decimal Character Number Entity Name --...