当前位置:网站首页>qrcode:将文本生成二维码
qrcode:将文本生成二维码
2022-07-05 02:43:00 【13少啊】
一.使用的方法
1.安装 yarn add qrcode或者npm i qrcode
2.导入 import Qrcode from 'qrcode'
3.定义一个canvas标签放二维码
<canvas ref="canvas" />4.生成
Qrcode.toCanvas(需要放置二维码的canvas标签,文本内容,{配制,宽度,高度....})二.实际操作
(1)下载

(2)导入
import Qrcode from 'qrcode'(3)定义一个canvas标签放二维码
<canvas ref="canvas" > </canvas>(4)生成
<template>
<div class="">
<canvas ref="canvas" >
</canvas >
<el-button @click="fn" type="primary" >点击生成</el-button>
</div>
</template>
<script>
import Qrcode from 'qrcode'
export default {
name: '',
methods: {
fn(){
Qrcode.toCanvas(this.$refs.canvas,'https://www.baidu.com/',{width:500,height:500})
}
}
}
</script>
<style scoped>
</style>

点击扫码就可以进入百度网页了。
边栏推荐
- Character painting, I use characters to draw a Bing Dwen Dwen
- The most powerful new household god card of Bank of communications. Apply to earn 2100 yuan. Hurry up if you haven't applied!
- Talk about the things that must be paid attention to when interviewing programmers
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Acwing第 58 场周赛【完结】
- Can you really learn 3DMAX modeling by self-study?
- openresty ngx_lua執行階段
- Linux安装Redis
- Bert fine tuning skills experiment
- Kotlin - 协程 Coroutine
猜你喜欢

CAM Pytorch

Unpool(nn.MaxUnpool2d)

Open source SPL optimized report application coping endlessly

Avoid material "minefields"! Play with super high conversion rate

【LeetCode】501. Mode in binary search tree (2 wrong questions)

Marubeni Baidu applet detailed configuration tutorial, approved.

【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)

Action News

【LeetCode】106. Construct binary tree from middle order and post order traversal sequence (wrong question 2)

Character painting, I use characters to draw a Bing Dwen Dwen
随机推荐
Sqoop命令
spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
【微服务|SCG】Filters的33种用法
Application and Optimization Practice of redis in vivo push platform
Hmi-30- [motion mode] the module on the right side of the instrument starts to write
Master Fur
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
返回二叉树中两个节点的最低公共祖先
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
[Yu Yue education] National Open University spring 2019 0505-22t basic nursing reference questions
Why is this an undefined behavior- Why is this an undefined behavior?
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
Medusa installation and simple use
Pytest (5) - assertion
Voice chip wt2003h4 B008 single chip to realize the quick design of intelligent doorbell scheme
Icu4c 70 source code download and compilation (win10, vs2022)
[download white paper] does your customer relationship management (CRM) really "manage" customers?
Apache build web host
问题解决:AttributeError: ‘NoneType‘ object has no attribute ‘append‘
Can you really learn 3DMAX modeling by self-study?