Vue QR Code Component

2.1.1 · maintenance · verified Sun Apr 19

vue-qrcode-component is a straightforward Vue.js component designed for embedding QR code generation directly within Vue applications. It provides a simple API for encoding text into QR codes, with options to customize size, foreground color, background color, and error correction level. The current stable version is 2.1.1. Given its last commit was several years ago (around 2020), it appears to be in a maintenance state, suitable for projects requiring basic QR code functionality without extensive configuration or advanced features. Its key differentiator is its minimal setup and direct integration into Vue 2 projects, offering a ready-to-use solution for adding QR codes with common customizations, rather than relying on a separate QR library and manually integrating it into a Vue wrapper. It does not actively support Vue 3.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to install, globally register the `qr-code` component within a Vue 2 application's entry point, and then use it in a template to display a URL, customizing its size, foreground/background colors, and error correction level.

import Vue from 'vue';
import VueQRCodeComponent from 'vue-qrcode-component';

// Register the component globally for use across your Vue 2 application
Vue.component('qr-code', VueQRCodeComponent);

// Create a new Vue instance to demonstrate the component in action
new Vue({
  el: '#app',
  template: `
    <div id="app">
      <h1>QR Code Example</h1>
      <p>Scan the code below:</p>
      <qr-code 
        text="https://checklist.day" 
        size="280" 
        color="#2c3e50" 
        bg-color="#ecf0f1" 
        error-level="M">
      </qr-code>
      <p>Customized QR code with specific colors and medium error correction.</p>
    </div>
  `
});

view raw JSON →