当前位置:网站首页>Qrcode: generate QR code from text
Qrcode: generate QR code from text
2022-07-05 02:45:00 【13 less】
One . Method used
1. install yarn add qrcode perhaps npm i qrcode
2. Import import Qrcode from 'qrcode'
3. Define a canvas Label QR code
<canvas ref="canvas" />4. Generate
Qrcode.toCanvas( Need to place QR code canvas label , Text content ,{ Preparation , Width , Height ....})Two . Actual operation
(1) download

(2) Import
import Qrcode from 'qrcode'(3) Define a canvas Label QR code
<canvas ref="canvas" > </canvas>(4) Generate
<template>
<div class="">
<canvas ref="canvas" >
</canvas >
<el-button @click="fn" type="primary" > Click generation </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>

Click scan code to enter Baidu website .
边栏推荐
- Advanced learning of MySQL -- Application -- Introduction
- 1.五层网络模型
- Serious bugs with lifted/nullable conversions from int, allowing conversion from decimal
- 【LeetCode】106. Construct binary tree from middle order and post order traversal sequence (wrong question 2)
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Design of kindergarten real-time monitoring and control system
- Voice chip wt2003h4 B008 single chip to realize the quick design of intelligent doorbell scheme
- Why is this an undefined behavior- Why is this an undefined behavior?
- Hmi-31- [motion mode] solve the problem of picture display of music module
- openresty ngx_lua变量操作
猜你喜欢

Yyds dry goods inventory intelligent fan based on CC2530 design

Exploration of short text analysis in the field of medical and health (I)

Learn game model 3D characters, come out to find a job?

Practical case of SQL optimization: speed up your database

Summary and practice of knowledge map construction technology

Azkaban实战
![[技术发展-26]:新型信息与通信网络的数据安全](/img/13/10c8bd340017c6516edef41cd3bf6f.png)
[技术发展-26]:新型信息与通信网络的数据安全

Azkaban安装部署

Design and implementation of kindergarten management system
![Hmi-32- [motion mode] add light panel and basic information column](/img/9c/0b25c0a41758652848aed2a269880f.jpg)
Hmi-32- [motion mode] add light panel and basic information column
随机推荐
Yyds dry goods inventory intelligent fan based on CC2530 design
100 basic multiple choice questions of C language (with answers) 04
Devtools的简单使用
2022/02/13
Structure of ViewModel
Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time
Breaking the information cocoon - my method of actively obtaining information - 3
The most powerful new household god card of Bank of communications. Apply to earn 2100 yuan. Hurry up if you haven't applied!
The phenomenology of crypto world: Pioneer entropy
[技术发展-26]:新型信息与通信网络的数据安全
Apache build web host
[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)
LeetCode --- 1071. Great common divisor of strings problem solving Report
【LeetCode】222. The number of nodes of a complete binary tree (2 mistakes)
Yolov5 model training and detection
The database and recharge are gone
Six stone programming: advantages of automated testing
Erreur de type de datagramme MySQL en utilisant Druid
tuple and point
Medusa installation and simple use