当前位置:网站首页>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>
点击扫码就可以进入百度网页了。
边栏推荐
- Last words record
- Unpool(nn.MaxUnpool2d)
- Apache build web host
- ASP. Net core 6 framework unveiling example demonstration [01]: initial programming experience
- Erreur de type de datagramme MySQL en utilisant Druid
- d3js小记
- Design and implementation of high availability website architecture
- GFS分布式文件系统
- Linux安装Redis
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
猜你喜欢
"C zero foundation introduction hundred knowledge and hundred cases" (72) multi wave entrustment -- Mom shouted for dinner
【LeetCode】110. Balanced binary tree (2 brushes of wrong questions)
Openresty ngx Lua Execution stage
8. Commodity management - commodity classification
【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
Yolov5 model training and detection
openresty ngx_lua執行階段
Spoon inserts and updates the Oracle database, and some prompts are inserted with errors. Assertion botch: negative time
Master Fur
随机推荐
Erreur de type de datagramme MySQL en utilisant Druid
Video display and hiding of imitation tudou.com
The database and recharge are gone
When to catch an exception and when to throw an exception- When to catch the Exception vs When to throw the Exceptions?
A label colorful navigation bar
SFTP cannot connect to the server # yyds dry goods inventory #
Application and Optimization Practice of redis in vivo push platform
Returns the lowest common ancestor of two nodes in a binary tree
Hmi-32- [motion mode] add light panel and basic information column
Serious bugs with lifted/nullable conversions from int, allowing conversion from decimal
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
看 TDengine 社区英雄线上发布会,听 TD Hero 聊开发者传奇故事
Scientific research: are women better than men?
Sqoop安装
Vb+access hotel service management system
Uniapp navigateto jump failure
From task Run get return value - getting return value from task Run
【LeetCode】106. Construct binary tree from middle order and post order traversal sequence (wrong question 2)
Elk log analysis system
Moco V2 literature research [self supervised learning]