当前位置:网站首页>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>
点击扫码就可以进入百度网页了。
边栏推荐
- Hmi-32- [motion mode] add light panel and basic information column
- Sqoop命令
- 问题解决:AttributeError: ‘NoneType‘ object has no attribute ‘append‘
- Practical case of SQL optimization: speed up your database
- Redis distributed lock, lock code logic
- Apache build web host
- ELFK部署
- 使用druid連接MySQL數據庫報類型錯誤
- Avoid material "minefields"! Play with super high conversion rate
- [Yu Yue education] National Open University spring 2019 0505-22t basic nursing reference questions
猜你喜欢
Elfk deployment
Vb+access hotel service management system
Tiny series rendering tutorial
Sqoop安装
this+闭包+作用域 面试题
Open source SPL optimized report application coping endlessly
spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
Pytest (4) - test case execution sequence
看 TDengine 社区英雄线上发布会,听 TD Hero 聊开发者传奇故事
【LeetCode】404. Sum of left leaves (2 brushes of wrong questions)
随机推荐
ELFK部署
Last week's hot review (2.7-2.13)
Missile interception -- UPC winter vacation training match
【LeetCode】501. Mode in binary search tree (2 wrong questions)
Use the difference between "Chmod a + X" and "Chmod 755" [closed] - difference between using "Chmod a + X" and "Chmod 755" [closed]
Elfk deployment
Voice chip wt2003h4 B008 single chip to realize the quick design of intelligent doorbell scheme
Pytest (4) - test case execution sequence
Acwing第 58 场周赛【完结】
【微服务|SCG】Filters的33种用法
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
ELK日志分析系统
openresty ngx_lua執行階段
Android advanced interview question record in 2022
【LeetCode】111. Minimum depth of binary tree (2 brushes of wrong questions)
Linux安装Redis
[200 opencv routines] 99 Modified alpha mean filter
Breaking the information cocoon - my method of actively obtaining information - 3
College Students' innovation project management system
[daily problem insight] Li Kou - the 280th weekly match (I really didn't know it could be so simple to solve other people's problems)