欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

微信小程序二維碼生成工具 weapp-qrcode詳解

 更新時(shí)間:2021年10月22日 16:07:20   作者:sanyekui  
這篇文章主要介紹了微信小程序 二維碼生成工具 weapp-qrcode詳解,教大家如何在項(xiàng)目中引入weapp-qrcode.js文件,通過實(shí)例代碼給大家介紹的非常詳細(xì),需要的朋友可以參考下

微信小程序 - 二維碼生成工具

下載:weapp-qrcode.js文件

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

在項(xiàng)目中引入 weapp-qrcode.js 文件

js

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

Page({
    /**
     * 頁(yè)面的初始數(shù)據(jù)
     */
    data: {
        QrCodeURL:'', // 二維碼圖片路徑
    },
    // 二維碼
    drawImg: function (){
        let that = this,
            params = "https://www.baidu.com/";  // 二維碼參數(shù) 

        var imgData = QR.drawImg(params, {
            typeNumber: 4,          // 密度
            errorCorrectLevel: 'L', // 糾錯(cuò)等級(jí)
            size: 800,              // 白色邊框
        })
        
        this.setData({
            qrcodeURL: imgData
        })
    },
})

html

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

到此這篇關(guān)于微信小程序 二維碼生成工具 weapp-qrcode的文章就介紹到這了,更多相關(guān)微信小程序 二維碼生成工具內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論