qrcode & vue

qrcode & vue

740516-20190416135505695-1104722862.png


$ yarn add qrcode.vue 

# OR

$ npm i -S qrcode.vue

https://www.npmjs.com/package/qrcode.vue

740516-20190416105851405-1676186539.png

single-file components

demo-qrcode.vue


<template>
    <div>
        <qrcode-vue :value="url" :size="size" level="H"></qrcode-vue>
    </div>
</template>
 

bug

http://47.97.241.6:8080/eapp/iframeTest/index.html#https://m.weibo.cn

https://github.com/scopewu/qrcode.vue/issues/10

https://github.com/scopewu/qrcode.vue/blob/master/src/index.js

740516-20190429142112442-845281680.png

740516-20190429142214814-1552152227.png

solutions

level = L

https://github.com/scopewu/qrcode.vue#component-props

https://github.com/scopewu/qrcode.vue/issues/10#issuecomment-487810869

I think this a little bug of my code , because using the wrong the symbol's capacity.

740516-20190430113714521-1108110603.png


node-qrcode

https://www.npmjs.com/package/qrcode
https://github.com/soldair/node-qrcode


    setTimeout(() => {
        // const QRCode = require("qrcode");
        let canvas = document.getElementById("qrcode_canvas");
        // canvas.width = 100;
        // canvas.height = 100;
        // canvas.style.width  = "100px";
        // canvas.style.height = "100px";
        let url = this.url;
        QRCode.toCanvas(
            canvas,
            url,
            {
                width: 120,
                errorCorrectionLevel: "H",
            },
            function (error) {
                if (error) {
                    console.error(error);
                } else {
                    console.log("success!");
                }
            }
        );
    }, 0);

qrcode.js

https://davidshimjs.github.io/qrcodejs/
https://github.com/davidshimjs/qrcodejs

转载于:https://www.cnblogs.com/xgqfrms/p/10715627.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值