1. vue-qart
the Vue 2.x component of QArt.js
vue-qart
Package: vue-qart
Created by: superman66
Last modified: Tue, 28 Jun 2022 20:10:32 GMT
Version: 2.2.0
Downloads: 623
Repository: https://github.com/superman66/vue-qart

Install

npm install vue-qart
yarn add vue-qart

Travis npm npm

vue-qart

You should read it before you using vue-qart

because of qart.js's author doesn't publish the lastest version to npm. so, the new options size, version,background,fillType doesn't work in vue-qart until qart.js' author publish the lastest version.

For More Detail, seeing this issue: size option doesn't works

the Vue 2.x Component for kciter's qart.js





Check the DEMO

Installation

install with NPM

 npm install vue-qart --save

Import

 import VueQArt from 'vue-qart'

new Vue({
    components: {VueQArt}
})

Usage

In template

 <vue-q-art :config="config"></vue-q-art>

Set config value

 data () {
    return {
        msg: 'Welcome to Your Vue.js App',
        config: {
            value: 'https://www.baidu.com',
            imagePath: './examples/assets/logo.png',
            filter: 'color'
        }
    }
}

for imagePath prop, you can use base64 instead of image path.

For more details you should definitely check out qart.js

download to image

passing download props, to show download button, it support:

  • text - button text
  • visible - setting download button visible or not
  • style - setting download button style
  • type - image type,such as image/png
  • filename

you can download the qrcode to image by using canvas.toDataURL()

 const myCanvas = this.$refs.qart.children[0];
const type = 'image/png';
let image = myCanvas.toDataURL(type).replace(type, "image/octet-stream");
window.location.href = image; // it will save locally

Build Setup

 # install dependencies
npm install

# serve with hot reload at localhost:8080/demo/
npm run dev

# build demo 
npm run demo

# export the directive as a library
npm run build

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin