当前位置:网站首页>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 .
边栏推荐
- Pytest (4) - test case execution sequence
- 腾讯云,实现图片上传
- 【微服务|SCG】Filters的33种用法
- Sqoop命令
- Asp+access campus network goods trading platform
- Watch the online press conference of tdengine community heroes and listen to TD hero talk about the legend of developers
- ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
- spoon插入更新oracle数据库,插了一部分提示报错Assertion botch: negative time
- February database ranking: how long can Oracle remain the first?
- 使用druid連接MySQL數據庫報類型錯誤
猜你喜欢
2.常见的请求方法
Cut! 39 year old Ali P9, saved 150million
Character painting, I use characters to draw a Bing Dwen Dwen
8. Commodity management - commodity classification
Hmi-31- [motion mode] solve the problem of picture display of music module
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Azkaban实战
Exploration of short text analysis in the field of medical and health (II)
Character painting, I use characters to draw a Bing Dwen Dwen
Design of KTV intelligent dimming system based on MCU
随机推荐
SFTP cannot connect to the server # yyds dry goods inventory #
Yolov5 model training and detection
Cut! 39 year old Ali P9, saved 150million
【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
openresty ngx_lua执行阶段
February database ranking: how long can Oracle remain the first?
看 TDengine 社区英雄线上发布会,听 TD Hero 聊开发者传奇故事
丸子百度小程序详细配置教程,审核通过。
Master Fur
Which common ports should the server open
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
【LeetCode】111. Minimum depth of binary tree (2 brushes of wrong questions)
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
Learn game model 3D characters, come out to find a job?
Android advanced interview question record in 2022
openresty ngx_lua变量操作
Application and Optimization Practice of redis in vivo push platform
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Naacl 2021 | contrastive learning sweeping text clustering task