In-depth understanding of Vue's method of generating QR codes using vue-qr

In-depth understanding of Vue's method of generating QR codes using vue-qr

The English name of “QR Code” is “QR Code”. “QR” is the abbreviation of “Quick Response”, which reflects that this QR code has the characteristic of “ultra-high-speed reading”. “Quick Response Code” means “Quick response code”.

npm download

npm install vue-qr --save

Download Success:

insert image description here

step

(1) Import

import VueQr from 'vue-qr'

(2) vue-qr parameters

  • text QR code, that is, the page you jump to after scanning the QR code
  • size QR code size
  • margin The margin of the QR code image, default 20px
  • bgSrc embedded background image address
  • logoSrc is embedded into the LOGO address in the center of the QR code
  • logoScale size of the middle image
  • dotScale The size of the dots in the QR code
  • colorDark The color of the solid point (Note: only valid when set together with colorLight)
  • colorLight blank color (Note: only works when set with colorDark)
  • If autoColor is true, the main color of the background image will be used as the color of the solid point, that is, colorDark. The default is true

Example

<template>
   <div>
      <vue-qr
         :text="imgUrl"
         :size="250"
         :logoSrc="logo"
         :logoScale="0.2">
      </vue-qr>
   </div>
</template>
<script>
import VueQr from 'vue-qr'
export default {
   name:'', 
   components:{
      VueQr,
   },
   data() {
      return {
         imgUrl: 'https://baidu.com',
         logo: require('@/assets/tea_128.png'),
      }
   },
   methods:{
   },
}
</script>

result:

insert image description here

Summarize

This article ends here. I hope it can be helpful to you. I also hope you can pay more attention to more content on 123WORDPRESS.COM!

You may also be interested in:
  • How to dynamically generate QR codes in Vue
  • Use vue-qriously plugin to generate QR code in vue
  • Vue WeChat scans QR code but Apple can only save pictures (solution)
  • An example of a simple implementation method for generating a QR code using vue

<<:  Sample code for making a drop-down menu using pure CSS

>>:  The impact of limit on query performance in MySQL

Recommend

How to upgrade MySQL 5.6 to 5.7 under Windows

Written in front There are two ways to upgrade My...

Based on the special characters in the URL escape encoding

Table of contents Special characters in URLs URL ...

jQuery implements Table paging effect

This article shares the specific code of jQuery t...

5 Tips for Protecting Your MySQL Data Warehouse

Aggregating data from various sources allows the ...

MySQL 8.0.14 installation and configuration method graphic tutorial (general)

MySQL service 8.0.14 installation (general), for ...

Nginx/Httpd reverse proxy tomcat configuration tutorial

In the previous blog, we learned about the usage ...

Mysql implements three functions for field splicing

When exporting data to operations, it is inevitab...

How to use CSS to achieve data hotspot effect

The effect is as follows: analyze 1. Here you can...

MySQL multi-table join introductory tutorial

Connections can be used to query, update, and est...

How to install Windows Server 2008 R2 on Dell R720 server

Note: All pictures in this article are collected ...

MySQL executes commands for external sql script files

Table of contents 1. Create a sql script file con...