HarmonyOS应用开发-qrcode二维码生成

HarmonyOS应用开发-qrcode二维码生成,第1张


一.创建项目
二.示例代码

Hml代码:


    Type
    
    
    
    Color
    
    Background Color
    

 Css代码:

.container {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.txt {
    color: orangered;
}

Js代码:

export default {
    data: {
        qr_value:"这里是扫出的二维码内容",
        qr_type: 'rect',
        qr_size: '200px',
        qr_col: '#333',
        col_list: ['#87ceeb','#fa8072','#da70d6','#80ff00ff','#00ff00ff'],
        qr_bcol: '#f0ffff',
        bcol_list: ['#f0ffff','#ffffef','#d8bfd8']
    },
    setType(e) {
        if (e.checked) {
            this.qr_type = 'rect'
        } else {
            this.qr_type = 'circle'
        }
    },
    setColor(e) {
        this.qr_col = e.newValue
    },
    setColorB(e) {
        this.qr_bcol = e.newValue
    }
}
实例效果

 

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/945102.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-18
下一篇2022-05-18

发表评论

登录后才能评论

评论列表(0条)

    保存