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 optimize the slow Like fuzzy query in MySQL

Table of contents 1. Introduction: 2. The first i...

Minimalistic website design examples

Web Application Class 1. DownForEveryoneOrJustMe ...

Summary of 28 common JavaScript string methods and usage tips

Table of contents Preface 1. Get the length of a ...

How to remove spaces or specified characters in a string in Shell

There are many methods on the Internet that, alth...

How to install kibana tokenizer inside docker container

step: 1. Create a new docker-compose.yml file in ...

Rules for using mysql joint indexes

A joint index is also called a composite index. F...

Difference between HTML ReadOnly and Enabled

The TextBox with the ReadOnly attribute will be di...

How to use javascript to do simple algorithms

Table of contents 1 Question 2 Methods 3 Experime...

How to dynamically modify the replication filter in mysql

MySQL dynamically modify replication filters Let ...

Docker Stack deployment method steps for web cluster

Docker is becoming more and more mature and its f...