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

描述

HarmonyOS

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

Hml代码:


TypeColor{{$item}}Background Color{{$item}}

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
    }
}

审核编辑:符乾江
打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分