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;"& ...
随机推荐
- You are what you write——沈向洋
title: You are what you write--沈向洋 date: 2018-02-21 13:18:28 tags: [随想,write] categories: 个人文章 --- A ...
- kafka配置记录
1. 准备三台机器,系统CentOs6 2. 安装好JDK和zookeeper 参考: zookeeper配置记录 3. 解压安装包到指定目录 tar -zxvf kafka_2.12-2.1.0.t ...
- 微信小程序解密得到unoinid和手机号 (开放数据的校验和解密 获取手机号)
实际测试 两种方法都可以: 第一种方法: public static string DecodeUserInfo(string encryptedData, string iv, string cod ...
- Android Studio获取开发版SHA1值和发布版SHA1值的史上最详细方法
前言: 今天我想把百度地图的定位集成到项目中来,想写个小小的案例,实现一下,但在集成百度地图时首先要申请秘钥,申请秘钥要用到SHA1值,所以今天就来总结一下怎样去获取这个值吧,希望对大家有帮助. 正常 ...
- 当我们按下电源键,Android 究竟做了些什么?
欢迎大家前往腾讯云+社区,获取更多腾讯海量技术实践干货哦~ 本文由goo发表于云+社区专栏 相信我们对Android系统都不陌生,而Android系统博大精深,被各种各样的智能设备承载的同时,我们会否 ...
- ButterKnife注解式绑定控件
Butter Knife Android为控件设计的注解绑定库. github地址:https://github.com/JakeWharton/butterknife 添加依赖:(具体看github ...
- 【学习笔记】【Design idea】一、Java异常的设计思想、性能相关、笔记
1.前言: 异常.本该是多么优雅的东西,然而,得全靠自己在零散的信息中汇集. 学习笔记保持更新. 2.教材(参考资料) 其他 ①受检异常与非受检异常:https://www.cnblogs.com/j ...
- C#基础第六天
数组 方法 实现代码的重用 参数 返回值 注释 return 语法:[public] static 返回值类型 方法名([参数列表]){ 方法体;}public:访问修饰符,公开的,公共的s ...
- bootstrap,bootstrap-table,bootstrapValidator,animate,layer配合起来搞事情
资源准备(just download) bootstrap: http://www.bootcss.com/ bootstrap-table: http://bootstrap-table.wenzh ...
- 5.机器学习——DBSCAN聚类算法
1.优缺点 优点: (1)聚类速度快且能够有效处理噪声点和发现任意形状的空间聚类: (2)与K-MEANS比较起来,不需要输入要划分的聚类个数: (3)聚类簇的形状没有偏倚: (4)可以在需要时输入过 ...