# vue-chocolat

> Chocolat extension wrapper for VueJs

Latest version **1.1.8** (published 2021-05-08) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.8 |
| Published | 2021-05-08 |
| First published | 2020-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 19.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Eliamar Tani |
| Maintainers | eliamartani |
| Keywords | vuejs, chocolat |

## Links

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

## Dependencies (1)

- [chocolat](https://npm.io/package/chocolat.md) ^1.0.4

## Recent versions

- 1.1.8 (latest) — 2021-05-08
- 1.1.7 — 2021-05-02
- 1.1.6 — 2021-03-13
- 1.1.4 — 2021-02-14
- 1.1.2 — 2020-09-12
- 1.1.1 — 2020-08-08
- 1.1.0 — 2020-07-26
- 1.0.3 — 2020-07-25
- 1.0.1 — 2020-04-15
- 1.0.0 — 2020-04-12

## README

# vue-chocolat

VueJs component to work with `Chocolat` 🐴

## Table of Contents

- [vue-chocolat](#vue-chocolat)
  - [Table of Contents](#table-of-contents)
  - [Install](#install)
    - [In package.json](#in-packagejson)
    - [In Component](#in-component)
  - [Props](#props)
  - [API](#api)
    - [Todo list](#todo-list)
  - [Examples](#examples)
  - [Reference](#reference)
  - [License](#license)

## Install

### In package.json

The component can be installed by executing

```bash
npm install --save vue-chocolat
# or yarn add vue-chocolat
```

### In Component

Add it globally

```javascript
import vueChocolat from 'vue-chocolat'

// ...

Vue.component('vue-chocolat', vueChocolat)
```

or locally

```javascript
import vueChocolat from 'vue-chocolat'

// ...

export default {
  // ...
  components: {
    'vue-chocolat': vueChocolat
    // or even in a async way
    // 'vue-chocolat': () => import('vue-chocolat')
  }
}
```

## Props

No properties are required altough you'll have a better control over the component when using it.

- items
  - default: `null`
  - required: `false`
  - type: `Array`
  - [Reference link](https://chocolat.gitbook.io/chocolat/usage#instanciating-using-javascript-objects)
- options
  - default: `undefined`
  - required: `false`
  - type: `Object`
  - [Reference link](https://chocolat.gitbook.io/chocolat/options)
- selector
  - default: `:scope > a`
  - required: `false`
  - type: `String`

`items` create a gallery, `selector` creates a collection of clickable elements. You can't use both of them at once.

## API

[Reference link](https://chocolat.gitbook.io/chocolat/api)

When creating a `<vue-chocolat>` component you'll have access to its `api` by adding a `ref` attribute to it.

```html
<!-- Name whatever you prefer instead of `instance` -->
<vue-chocolat ref="instance"></vue-chocolat>
```

```javascript
someMethod() {
  const { api } = this.$refs.instance

  // see the reference link to full detailed information
  api.open(1)
  api.close()
  api.next()
  api.prev()
  // etc
}
```

### Todo list

- [ ] Improve API interface

## Examples

Examples can be found here:

- [Examples](https://eliamartani.github.io/vue-chocolat/examples)

Live examples can be found at Chocolat's page.

## Reference

- http://chocolat.insipi.de/

## License

[MIT](LICENSE)

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