当前位置:网站首页>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 .
边栏推荐
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- Unpool(nn.MaxUnpool2d)
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- Single line function*
- Azkaban实战
- 【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
- Application and Optimization Practice of redis in vivo push platform
- Flume配置4——自定义MYSQLSource
- Scientific research: are women better than men?
- Apache build web host
猜你喜欢
Hmi-31- [motion mode] solve the problem of picture display of music module
Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 1)
Yolov5 model training and detection
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
Avoid material "minefields"! Play with super high conversion rate
Open source SPL optimized report application coping endlessly
Yuan universe also "real estate"? Multiple second-hand trading websites block metauniverse keywords
Sqoop命令
Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time
LeetCode 314. Binary tree vertical order traversal - Binary Tree Series Question 6
随机推荐
Flume配置4——自定义MYSQLSource
When the low alcohol race track enters the reshuffle period, how can the new brand break the three major problems?
The database and recharge are gone
【LeetCode】404. Sum of left leaves (2 brushes of wrong questions)
Icu4c 70 source code download and compilation (win10, vs2022)
The phenomenology of crypto world: Pioneer entropy
Design and implementation of kindergarten management system
Apache build web host
Elk log analysis system
问题解决:AttributeError: ‘NoneType‘ object has no attribute ‘append‘
Character painting, I use characters to draw a Bing Dwen Dwen
Traditional chips and AI chips
数据库和充值都没有了
【LeetCode】501. Mode in binary search tree (2 wrong questions)
打破信息茧房-我主动获取信息的方法 -#3
D3js notes
Eight days of learning C language - while loop (embedded) (single chip microcomputer)
Character painting, I use characters to draw a Bing Dwen Dwen
Azkaban安装部署
Zabbix