1.1.8 • Published 3 years ago

vue-chocolat v1.1.8

Weekly downloads
11
License
MIT
Repository
github
Last release
3 years ago

vue-chocolat

VueJs component to work with Chocolat 🐴

Table of Contents

Install

In package.json

The component can be installed by executing

npm install --save vue-chocolat
# or yarn add vue-chocolat

In Component

Add it globally

import vueChocolat from 'vue-chocolat'

// ...

Vue.component('vue-chocolat', vueChocolat)

or locally

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
  • 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

When creating a <vue-chocolat> component you'll have access to its api by adding a ref attribute to it.

<!-- Name whatever you prefer instead of `instance` -->
<vue-chocolat ref="instance"></vue-chocolat>
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:

Live examples can be found at Chocolat's page.

Reference

License

MIT

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.4

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago