Socket
Socket
Sign inDemoInstall

qrcode-vuejs

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    qrcode-vuejs

QR Code generator for Vue.js


Version published
Weekly downloads
7
decreased by-12.5%
Maintainers
1
Install size
76.9 kB
Created
Weekly downloads
 

Readme

Source

QRCode Generator for Vue

QR code implementation based on https://github.com/kazuhikoarase/qrcode-generator

Online Demo

Installation

npm i qrcode-vuejs

Usage

Import
import VQrcode, { ErrorCorrectLevel, RenderOptions } from 'qrcode-vuejs';
Basic
// register component
import { createApp } from 'vue';
import VQrcode from 'qrcode-vue';
import TestView from './TestView.vue';

const app = createApp(TestView);
app.use(VQrcode);
app.mount('#test');
Plugin
// register component
import { createApp } from 'vue';
import VQrcode, { ErrorCorrectLevel, RenderOptions } from 'qrcode-vuejs';
import TestView from './TestView.vue';

const app = createApp(TestView);
app.use(VQrcode, {
    size: 200,
    colorDark: '#000000',
    colorLight: '#ffffff',
    correctLevel: ErrorCorrectLevel.M,
    render: RenderOptions.CANVAS,
});
app.mount('#test');


<script setup lang="ts"></script>
<template>
    <v-qrcode text="https://ishinvin.github.io" />
</template>
Import Component
// Single-File Components
<script setup lang="ts">
import { VQrcode, RenderOptions, ErrorCorrectLevel } from 'qrcode-vuejs';
</script>

<template>
    <v-qrcode
        text="https://ishinvin.github.io"
        :size="200"
        :render="RenderOptions.CANVAS"
        :correct-level="ErrorCorrectLevel.M"
        color-dark="#000000"
        color-light="#ffffff"
    />
</template>

Props

NameTypeDefaultDescription
textstringQR string value to generate
sizenumber200Size of the QR code canvas
renderRenderOptionsCANVASRender type (CANVAS, SVG, IMAGE, HTML)
color-darkstring#000000Foreground color of the QR
color-lightstring#ffffffBackground color of the QR
correct-levelErrorCorrectLevelMQR Code has error correction capability to restore data if the code is dirty or damaged. (L = Approx 7%, M = Approx 15%, Q = Approx 25%, H = Approx 30%)

Keywords

FAQs

Last updated on 13 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc