当前位置:网站首页>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>
点击扫码就可以进入百度网页了。
边栏推荐
- openresty ngx_lua執行階段
- Unpool(nn.MaxUnpool2d)
- Good documentation
- A tab Sina navigation bar
- 【LeetCode】111. Minimum depth of binary tree (2 brushes of wrong questions)
- Erreur de type de datagramme MySQL en utilisant Druid
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Problem solving: attributeerror: 'nonetype' object has no attribute 'append‘
- Medusa installation and simple use
- The most powerful new household god card of Bank of communications. Apply to earn 2100 yuan. Hurry up if you haven't applied!
猜你喜欢
Yyds dry goods inventory intelligent fan based on CC2530 design
Cut! 39 year old Ali P9, saved 150million
Design of kindergarten real-time monitoring and control system
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
【LeetCode】110. Balanced binary tree (2 brushes of wrong questions)
丸子百度小程序详细配置教程,审核通过。
Tiny series rendering tutorial
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
openresty ngx_lua執行階段
Icu4c 70 source code download and compilation (win10, vs2022)
随机推荐
Structure of ViewModel
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)
【微服务|SCG】Filters的33种用法
Sqoop安装
Acwing game 58 [End]
Unpool(nn.MaxUnpool2d)
Design of kindergarten real-time monitoring and control system
Which common ports should the server open
Bert fine tuning skills experiment
Zabbix
openresty ngx_ Lua variable operation
Summary and practice of knowledge map construction technology
Apache build web host
Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time
Avoid material "minefields"! Play with super high conversion rate
GFS分布式文件系统
Icu4c 70 source code download and compilation (win10, vs2022)
Hmi-30- [motion mode] the module on the right side of the instrument starts to write
RichView TRVStyle MainRVStyle