Giter Club home page Giter Club logo

vue-chk's Introduction

vue-chk

Custom checkbox made simple at its best.

Simple example

Install

NPM:

npm install vue-chk

Yarn:

yarn vue-chk

Vue-Chk

Usage

Globally:

import chk from 'vue-chk'

Vue.component('vue-chk', chk)

or inside component:

import VueChk from 'vue-chk'

export default {
  components: {
    'vue-chk': VueChk
  }
}

Asynchronously:

export default {
  components: {
    'vue-chk': () => import('vue-chk')
  }
}

After that:

<vue-chk v-model="prop">Check me</vue-chk>

Property

v-model: Boolean, Date, String, Number

Vue-Chk-List

Usage

Globally:

import { CheckboxList } from 'vue-chk'

Vue.component('vue-chk-list', CheckboxList)

or inside component:

import { CheckboxList } from 'vue-chk'

export default {
  components: {
    'vue-chk-list': CheckboxList
  }
}

After that:

<vue-chk-list v-model="values" :list="items" />

<!-- or -->

<vue-chk-list v-model="values" :list="items">
  <template slot="item--slot" slot-scope="item">{{ item.label }}</template>
</vue-chk-list>

Properties

  • v-model: Array object where all checked items are saved
  • list: Array object with its items to be showed

Slot

The list offers the possibility to customize what will be shown, its slot is named item--slot with its scope representing an item inside the list property

<template slot="item--slot" slot-scope="{ item }">{{ item.label }}</template>

API

@input (totally optional): Triggers when checkbox is clicked

Customizing

You do it, only a few css were added to make it work.

License

MIT

vue-chk's People

Contributors

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

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.