# vue-shave

> A wrapper Vue Directive for shave.js

Latest version **1.0.3** (published 2017-08-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-shave
pnpm add vue-shave
yarn add vue-shave
bun add vue-shave
```

## 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.0.3 |
| Published | 2017-08-24 |
| First published | 2017-06-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Maintainers | nicolajkn |

## Links

- npm: https://www.npmjs.com/package/vue-shave
- Repository: https://github.com/quantity-digital/vue-shave
- Homepage: https://github.com/quantity-digital/vue-shave#readme
- Issues: https://github.com/quantity-digital/vue-shave/issues
- npm.io page: https://npm.io/package/vue-shave

## Dependencies (1)

- [shave](https://npm.io/package/shave.md) ^2.0.2

## Recent versions

- 1.0.3 (latest) — 2017-08-24
- 1.0.2 — 2017-07-10
- 1.0.1 — 2017-07-03
- 1.0.0 — 2017-06-30

## README

# vue-shave
Simple Vue.js directive wrapper for [shave](https://github.com/dollarshaveclub/shave). This plugin also adds support for responsive media queries to shavejs. 

## Features

- Lightweight wrapper around `shave`.
- Runs `shave` on component updates.
- Adds responsive support to `shave`. 

## Installing

### With a module bundler (webpack, rollup, etc.)

Shave is installed as a dependency of vue-shave. 

```javascript
npm install vue-shave
```

Then initialize the plugin.

```javascript
// main.js
import VueShave from 'vue-shave';

Vue.use( VueShave );
```

### CDN

Include shave and vue-shave. 

**Note: Remember to include the shave library before `vue-shave`**

```html
<script src="https://unpkg.com/shave@2.0.2"></script>
<script src="https://unpkg.com/vue-shave@1.0.3"></script>
```

Then initialize the plugin.

```javascript
// main.js

Vue.use( VueShave );
```


### Options

Add global options as the second parameter.

```javascript
// main.js

const shaveConfig = {
  throttle: 400,    // Throttle length in ms
  character: '!!!', // Override default elipsis character
  spaces: true,     // Spaces config (see shave documentation)
  height: 80        // Default shave height (see shave documentation)
}; 

Vue.use( VueShave, shaveConfig );
```



### Examples

Simply add `v-shave` with a height to a text node to instantiale `shave`.

```html
<div v-shave="{ height: 80 }">
  <!-- text -->
</div>
```

Height is inherited from the global options, so you can do:

```html
<div v-shave>
  <!-- text -->
</div>
```

All `shave` options are supported:

```html
<div v-shave="{ height: 80, character: '!!!', spaces: false }">
  <!-- text -->
</div>
```

**Have fun!**

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