# ic-vue-qrcode

> An encapsulation of qrcodejs2 for convenient using in vue.js

Latest version **1.2.0** (published 2018-06-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install ic-vue-qrcode
pnpm add ic-vue-qrcode
yarn add ic-vue-qrcode
bun add ic-vue-qrcode
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2018-06-24 |
| First published | 2018-05-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 52.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | xxxxxMiss |
| Maintainers | qschqd |
| Keywords | qrcode, qrcodejs2, vue |

## Links

- npm: https://www.npmjs.com/package/ic-vue-qrcode
- Repository: https://github.com/xxxxxMiss/ic-utils/tree/master/packages/qrcode
- npm.io page: https://npm.io/package/ic-vue-qrcode

## Dependencies (2)

- [ic-utils](https://npm.io/package/ic-utils.md) ^1.0.16
- [qrcodejs2](https://npm.io/package/qrcodejs2.md) ^0.0.2

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2018-06-24
- 1.0.14 — 2018-05-25
- 1.0.11 — 2018-05-23
- 1.0.10 — 2018-05-23
- 1.0.3 — 2018-05-21
- 1.0.2 — 2018-05-21
- 1.0.1 — 2018-05-20

## README

# v-qrcode
> It is an encapsulation of [qrcodejs2](https://www.npmjs.com/package/qrcodejs2) for you using it by directive in Vue.

### Install
```
$ npm i ic-vue-qrcode || yarn add ic-vue-qrcode
```

### Usage
> There are two ways you can use it:

### As a global plugin

``` js
import Vue from 'vue'
import IcQRCode from 'ic-vue-qrcode'

Vue.use(IcQRCode)
```

### As a scoped directive

``` js
import { qrcodeDirective } from 'ic-vue-qrcode'

{
    directives: {
        'qrcode': qrcodeDirective,
        // ... other directives
    }
}
```

in template:

```
<template>
    <div v-qrcode="value">
        
    </div>
</template>

<script>
  export default {
    data () {
        return {
            value: '',
            // value: { text: '', width: '', ... }
        }
    },
    methods: {
        value () {
            // your logic code
            // return 'http://www.baidu.com'
            return {
                text: 'http://www.baidu.com',
                width: '',
                height: ''
                // some other options passed to qrcodejs2 lib
            }
        }
    }
  }
</script>
```

> The `value` can be a string, an object and a function returned a string or an object.

**NOTE**
> When you want to show qrcode in specified conditions, for examples: in `wechat` platform don't show it and showing in common browsers, you can pass an `enable` in value.

``` js
{
    text: '',
    // ...,
    enable: !isWechat
}
```

---
_Source: https://npm.io/package/ic-vue-qrcode · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
