Giter Club home page Giter Club logo

vue-chocolat's Introduction

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

vue-chocolat's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar eliamartani avatar nicolas-t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-chocolat's Issues

Vue3 Compatability?

I have a vue3 app and I get an error. Is there any way to make this compatible with vue3? The error I get is:

ERROR
[object HTMLImageElement]
at handleError (webpack-internal:///./node_modules/webpack-dev-server/client/overlay.js:252:58)
at eval (webpack-internal:///./node_modules/webpack-dev-server/client/overlay.js:275:7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.