qrcode & vue


$ yarn add qrcode.vue # OR $ npm i -S qrcode.vue

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

single-file components

demo-qrcode.vue


<template>
<div>
<qrcode-vue :value="url" :size="size" level="H"></qrcode-vue>
</div>
</template>
<script> import QrcodeVue from "qrcode.vue"';
export default {
data() {
return {
url: "https://github.xgqfrms.xyz",
size: 100,
}
},
components: {
QrcodeVue,
},
}
</script>

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

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.


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

qrcode & vue的更多相关文章

  1. VUE使用QRcode或者vue-qr生成二维码

    这里介绍两种vue生成二维码的方法 QRcode vue-qr vue-qr比QRcode功能多在可以在中间加logo 下面先介绍QRcode vue里安装qrcodejs的npm包 npm inst ...

  2. URL & QRcode auto generator

    URL & QRcode auto generator 二维码 npm & qrcode https://www.npmjs.com/package/qrcode https://ww ...

  3. vue环境中生成二维码

    <template><div><div id='code'></div><canvas id="canvas">< ...

  4. vue2.0 自定义 生成二维码(QRCode)组件

    1.自定义 生成二维码组件 QRCode.vue <!-- 生成二维码 组件 --> <template> <canvas class="qrcode-canv ...

  5. vue 二维码长按保存和复制内容

    效果图: 二维码用了 qrcode.vue npm install qrcode.vue --save 复制内容用了 vue-clipboard2 npm install vue-clipboard2 ...

  6. 移动端h5页面的那些坑

    最近一直在写移动端页面,由于之前写移动端写的比较少,所以此次踩过许多坑.特此总结一下: 1.<input type='button'>背景色在ios中的兼容性,颜色发白 解决办法:在全局样 ...

  7. Vue使用QRCode.js生成二维码

    1.安装qrcode npm install qrcode 2.组件中引入qrcode import QRCode from 'qrcode' 3.html代码 <div><span ...

  8. vue中使用qrcode,遇到两次渲染的问题

    1.安装 qrcodejs2: npm install qrcodejs2 --save 2.页面中引入: import QRCode from "qrcodejs2";   co ...

  9. Vue前端利用qrcode生成二维码

    <div id="qrcode" style="width: 560px;height: 560px;background-color: white;"& ...

随机推荐

  1. WEB前端 CSS(非布局)

    目录 WEB前端 CSS CSS引入方式 CSS结构 CSS选择器 直接选择器 组合选择器 分组选择器 也叫并集选择器 属性选择器 伪类选择器 伪元素选择器 CSS选择器是一个查找的过程,高效的查找影 ...

  2. Python re 模块

    Python re 模块 TOC 介绍 作用 正则表达式语法 贪婪和非贪婪 普通字符和特殊字符 分组(比较重要) re modul level 方法 正则表达式对象 匹配对象 常用例子 注意事项 Ja ...

  3. csharp: LocalDataCache.sync

    app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> ...

  4. JS 事件绑定,监听,委托(代理)

    我们经常会遇到JavaScript的事件机制,例如,事件绑定.事件监听.事件委托(事件代理)等.这些名词是什么意思呢,有什么作用呢? 在JavaScript中,有三种常用的绑定事件的方法: 在DOM元 ...

  5. angular懒加载

    生成module和routing.module文件 {//路径 path: 'InfectionFillInComponent', loadChildren: './component/his/inf ...

  6. Vue-指令

    1. v-text:这个指令用于将vue实例中的data内的属性渲染到标签内.有两种写法: 1. `<div v-text="数据"></div>`:该写法 ...

  7. 小米6X手机解锁(bl锁)

    1. http://www.miui.com/unlock/index.html,申请解锁2. 手机:“设置 -> 更多设置 -> 开发者选项 -> 设备解锁状态”中绑定账号和设备. ...

  8. kafka环境搭建

    kafka环境搭建 for mac 对应qq群号:616961231 在之前的文章中, 有学习能力和兴趣爱好的同学,自己动手维护测试环境,丰衣足食是最好的办法,今天我们来讲讲kafka在mac上的安装 ...

  9. SQLServer之创建索引视图

    索引视图创建注意事项 对视图创建的第一个索引必须是唯一聚集索引. 创建唯一聚集索引后,可以创建更多非聚集索引. 为视图创建唯一聚集索引可以提高查询性能,因为视图在数据库中的存储方式与具有聚集索引的表的 ...

  10. kmalloc分配物理内存与高端内存映射--Linux内存管理(十八)

    1 前景回顾 1.1 内核映射区 尽管vmalloc函数族可用于从高端内存域向内核映射页帧(这些在内核空间中通常是无法直接看到的), 但这并不是这些函数的实际用途. 重要的是强调以下事实 : 内核提供 ...