qrcode-vue

1.2.0 · abandoned · verified Sun Apr 19

This `qrcode-vue` package offers a Vue.js component for rendering QR codes directly within Vue applications. It utilizes the underlying `qr.js` library for all core QR code encoding functionalities, simplifying integration for Vue 2 developers. Key features include dynamic adjustment of QR code size, customization of background and foreground colors, and the ability to embed a logo image at the center of the generated QR code. While the latest version available on npm is 1.2.0, reportedly published approximately a year ago, the linked GitHub repository (l-ll/qrcode-vue) shows a severe lack of recent development, with the last commits and official releases (like v1.0.0) dating back to 2017. This strong indication of abandonment means the package is not actively maintained and lacks crucial updates or support for modern Vue ecosystems, particularly Vue 3, with which it is not inherently compatible without significant refactoring. Its release cadence is effectively non-existent, making it a risky choice for new projects.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates basic integration of `qrcode-vue` into a Vue 2 application, showing prop binding for value, size, colors, and logo, along with dynamic updates.

<template>
  <div id="app">
    <p>Scan this QR code!</p>
    <qrcode-vue 
      :size="size" 
      :value="value" 
      :logo="logo" 
      :bgColor="bgColor" 
      :fgColor="fgColor"
      level="H"
    ></qrcode-vue>
    <p>Current value: {{ value }}</p>
    <p>Size: {{ size }}px</p>
    <p>
      <button @click="changeValue">Change Value</button>
      <button @click="changeSize">Toggle Size</button>
    </p>
  </div>
</template>

<script>
  import QrcodeVue from 'qrcode-vue';

  export default {
    components: {
      QrcodeVue
    },
    data () {
      return {
        size: 160,
        bgColor: '#ffffff',
        fgColor: '#000000',
        value: 'https://checklist.day/quickstart-example',
        logo: 'https://vuejs.org/images/logo.png' // Using Vue logo for example
      }
    },
    methods: {
      changeValue() {
        this.value = this.value === 'https://checklist.day/quickstart-example'
          ? 'https://github.com/l-ll/qrcode-vue'
          : 'https://checklist.day/quickstart-example';
      },
      changeSize() {
        this.size = this.size === 160 ? 200 : 160;
      }
    }
  }
</script>

view raw JSON →