# vue-easy-mq

> Yet another simple and easy to use media query plugin for Vue

Latest version **0.1.7** (published 2019-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-easy-mq
pnpm add vue-easy-mq
yarn add vue-easy-mq
bun add vue-easy-mq
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2019-07-28 |
| First published | 2019-07-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 242.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fokap |
| Maintainers | fokap |
| Keywords | vue, media query |

## Links

- npm: https://www.npmjs.com/package/vue-easy-mq
- Repository: https://github.com/fokinko/vue-easy-mq
- Homepage: https://github.com/fokinko/vue-easy-mq#readme
- Issues: https://github.com/fokinko/vue-easy-mq/issues
- npm.io page: https://npm.io/package/vue-easy-mq

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.1.7 (latest) — 2019-07-28
- 0.1.6 — 2019-07-26
- 0.1.5 — 2019-07-24
- 0.1.4 — 2019-07-23
- 0.1.3 — 2019-07-23
- 0.1.2 — 2019-07-23
- 0.1.1 — 2019-07-23
- 0.1.0 — 2019-07-23

## README

# vue-easy-mq

Yet another simple and easy to use media query plugin for Vue

## Usage

Install vue-easy-mq

```
npm i vue-easy-mq --save
```

Import and cofigure vue-easy-mq

```import Vue from 'vue
import vueEasyMq from 'vue-easy-mq'

Vue.use(vueEasyMq, { debug: true, breakpoints: 'vuetify' })
```

Use vue-easy-mq inside your code or template
```
if (this.$mq.width > 1000 && this.$mq.height > 500) {
  
}

if (this.$mq.media === 'xs'){
  ...
}

if (this.$mq.gt('sm')) {
  ...
}
```

## Reference
```
Vue.use(easyVueMq, options)

options: {
  debug: true,
  breakpoints: 'bootstrap4'
}
```
debug: Boolean - should a debug div be displayed at the top left corner of the window with width, height and matched media info

breakpoints: can be 'bootstrap3, 'bootstrap4', 'vuetify', or can be an array. If nothing or an empty array is provided, 'bootstrap4' will be used 
```
options: {
  breakpoints: [
    { break1: max-width in px },
    { break2: max-width in px },
    { break3: max-width in px },
    { break4: 0 /* no max-width */ }
  ]
}
```

Exposes $mq object
```
this.$mq = {
  width,          // detected width
  height,         // detected height
  media,          // matched width media breakpoint according to the breakpoints definition
  eq(break1),     // width is equal-than breakpoint, returns boolean
  lt(break2),     // width is less-than breakpoint, returns boolean
  gt(break3)      // width is greater-than breakpoint, returns boolean
}
```

## License

MIT

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