Giter VIP home page Giter VIP logo

vue-qart's Introduction

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

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

vue-qart's People

Contributors

superman66 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.