qrcode & vue
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的更多相关文章
- VUE使用QRcode或者vue-qr生成二维码
这里介绍两种vue生成二维码的方法 QRcode vue-qr vue-qr比QRcode功能多在可以在中间加logo 下面先介绍QRcode vue里安装qrcodejs的npm包 npm inst ...
- URL & QRcode auto generator
URL & QRcode auto generator 二维码 npm & qrcode https://www.npmjs.com/package/qrcode https://ww ...
- vue环境中生成二维码
<template><div><div id='code'></div><canvas id="canvas">< ...
- vue2.0 自定义 生成二维码(QRCode)组件
1.自定义 生成二维码组件 QRCode.vue <!-- 生成二维码 组件 --> <template> <canvas class="qrcode-canv ...
- vue 二维码长按保存和复制内容
效果图: 二维码用了 qrcode.vue npm install qrcode.vue --save 复制内容用了 vue-clipboard2 npm install vue-clipboard2 ...
- 移动端h5页面的那些坑
最近一直在写移动端页面,由于之前写移动端写的比较少,所以此次踩过许多坑.特此总结一下: 1.<input type='button'>背景色在ios中的兼容性,颜色发白 解决办法:在全局样 ...
- Vue使用QRCode.js生成二维码
1.安装qrcode npm install qrcode 2.组件中引入qrcode import QRCode from 'qrcode' 3.html代码 <div><span ...
- vue中使用qrcode,遇到两次渲染的问题
1.安装 qrcodejs2: npm install qrcodejs2 --save 2.页面中引入: import QRCode from "qrcodejs2"; co ...
- Vue前端利用qrcode生成二维码
<div id="qrcode" style="width: 560px;height: 560px;background-color: white;"& ...
随机推荐
- JAVA Swing 改变标题栏左上角默认咖啡图标
前言 最近使用Java的swing开发了一个小程序,想要实现改变标题栏左上角的图标,找了网上的资料,经过了一个下午的尝试,都是未能成功,最后,终于是在Java的一本书上找到了结果 我只能说,网上的东西 ...
- Maven项目POM文件错误,提示“Plugin execution not covered by lifecycle configuration”的解决方案
一. 问题 Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-depend ...
- vs2013中集成Git
一:为什么不用2013中自带的? 我的2013自带的没法用,连最基本的克隆都用不了,网上看着下 好像说都不能用:不知道各位的如何. 二:如何自己讲Git集成到vs2013中? 需要的工具: ...
- jQuery 父iframe与子iframe 相互调用传值
来自:https://blog.csdn.net/wd4871/article/details/50517597 侵删 父页面中的iframe :如下 <iframe name="su ...
- 【Dojo 1.x】笔记5 使用本地引用
习惯用CDN引用的同学肯定会知道还有一种叫本地引用,这篇笔记测试本地引用. Dojo SDK下载地址:点我 下载中间的Release Package即可,如果希望下载完整包(Full Source), ...
- 【阿里云】在 Windows Server 2016 下使用 FileZilla Server 安装搭建 FTP 服务
Windows Server 2016 下使用 FileZilla Server 安装搭建 FTP 服务 一.安装 Filezilla Server 下载最新版本的 Filezilla Server ...
- EBGP在非直连网络时,需要配置ebgp的最大跳数,否则无法建立非直连的EBGP邻居
结论: 1.默认情况下,EBGP只能在物理直连的路由器之间建立邻居. 2.要想配置非直连设备间的BGP邻居,必须加配置. 组网图: 抓包: 1.默认情况下,EBGP邻居之间的BGP报文的TTL为1. ...
- JIRA笔记(一):安装部署JIRA
(一) 说明 说明JIRA的安装及破解. 操作系统:WIN 10 数据库:Oracle 12C R2(这个版本的jira,atlassian建议的是 12C R1,不过R2也能用,其他版本不清 ...
- base64文件大小计算
有时候图片被base64之后需要计算图片大小,因为被编码后全是字符,计算文件大小可以反序列化成文件之后再获取大小,但是会比较麻烦.简单介绍一种利用base64编码原理计算大小的方法. 编码原理 要求把 ...
- 会话固定攻击 - yxcms session固定漏洞
目录 会话固定攻击 e.g. yxcms session固定攻击 分析 了解更多 会话固定攻击 Session fixation attack(会话固定攻击)是利用服务器的session不变机制,借他 ...