Code Monkey home page Code Monkey logo

v-chip's Introduction

v-chip

A Chip component for VueJS

npm

Installation

npm install --save v-chip

Import on a single component

import Vue from 'vue'
import VChip from 'v-chip'
import VChipInput from 'v-chip/src/v-chip-input.js'

Vue.use(VChip)
Vue.use(VChipInput)

Examples

<template>
	<div>

		<!-- Label only -->
		<v-chip label="Jane Doe"></v-chip>

		<!-- Label and image -->
		<v-chip img-src="avatar.jpg" label="Jane Doe"></v-chip>

		<!-- Closable chip with label -->
		<v-chip label="John Doe" :closable="true"></v-chip>

		<!-- Closable chip with label and image -->
		<v-chip img-src="avatar.jpg" label="John Doe" :closable="true"></v-chip>

		<!-- With text and background color -->
		<v-chip img-src="avatar.jpg" label="Harry Doe" :closable="true" bg-color="#003b62" color="#89aec5"></v-chip>


		<!-- chips from input field -->
		<v-chip-input v-model="humans"></v-chip-input>

		<!-- chips from options -->
		<v-chip-input v-model="names" :options="planets"></v-chip-input>

		<ul>
			<li v-for="human in humans"> {{ human }}</li>
		</ul>

		<ul>
			<li v-for="destination in destinations"> {{ destination }}</li>
		</ul>
	</div>
</template>

<script>
	export default {
		data(){
			return {
				humans: [],
				destinations: [],
				planets: ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn',  'Uranus', 'Neptune', 'Pluto']
			}
		},

		
	}
</script>

Properties

v-chip

name type required default
label String true null
img-src String false null
closable Boolean false false
color String false #333
bg-color String false #f1f1f1

v-chip-input

name type required default
options Array false null
v-model Array true null
input-class String false null

Author

Olu Udeh

License

This project is licensed under MIT License

v-chip's People

Contributors

oluudeh avatar

Stargazers

 avatar  avatar  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.