当前位置:网站首页>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>

点击扫码就可以进入百度网页了。
边栏推荐
- tuple and point
- Asynchronous and promise
- Introduce reflow & repaint, and how to optimize it?
- College Students' innovation project management system
- this+闭包+作用域 面试题
- Design and implementation of campus epidemic prevention and control system based on SSM
- ELFK部署
- 数据库和充值都没有了
- Exploration of short text analysis in the field of medical and health (II)
- Kotlin - 协程 Coroutine
猜你喜欢

Flume配置4——自定义MYSQLSource

College Students' innovation project management system

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety

this+闭包+作用域 面试题
![Hmi-31- [motion mode] solve the problem of picture display of music module](/img/9c/0b25c0a41758652848aed2a269880f.jpg)
Hmi-31- [motion mode] solve the problem of picture display of music module

Avoid material "minefields"! Play with super high conversion rate

2.常见的请求方法
![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

Design and implementation of community hospital information system

Introduce reflow & repaint, and how to optimize it?
随机推荐
The most powerful new household god card of Bank of communications. Apply to earn 2100 yuan. Hurry up if you haven't applied!
【LeetCode】110. Balanced binary tree (2 brushes of wrong questions)
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
Practical case of SQL optimization: speed up your database
Hmi-31- [motion mode] solve the problem of picture display of music module
Sqoop命令
[技术发展-26]:新型信息与通信网络的数据安全
openresty ngx_ Lua variable operation
Azkaban实战
Idea inheritance relationship
[机缘参悟-38]:鬼谷子-第五飞箝篇 - 警示之一:有一种杀称为“捧杀”
Yyds dry goods inventory intelligent fan based on CC2530 design
丸子百度小程序详细配置教程,审核通过。
Day_ 17 IO stream file class
8. Commodity management - commodity classification
Variables in postman
Using druid to connect to MySQL database reports the wrong type
1.五层网络模型
2021 Li Hongyi machine learning (2): pytorch
"C zero foundation introduction hundred knowledge and hundred cases" (72) multi wave entrustment -- Mom shouted for dinner