1.0.1 • Published 3 years ago

@shapla/vue-chip v1.0.1

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

Shapla Chip

Chip component is a small, interactive element. Chips are commonly used for contacts, text, rules, icons, and photos.

Table of contents

Installation

npm install --save @shapla/vue-chip

Usage

Styles

with SCSS:

import '@shapla/vue-chip/src/index.scss';

with CSS:

import '@shapla/vue-chip/dist/style.css';

Javascript Instantiation

import ShaplaChip from '@shapla/vue-chip';

export default {
  name: 'Hello',

  components: {
    ShaplaChip
  }
}
<shapla-chip text="Sayful Islam" :deletable="true" @delete="handleDeleteEvent"/>

Props

PropertyTypeRequiredDefaultDescription
textStringno | Chip text
image_srcStringno | Chip contact image url
deletableBooleannofalseIf set true, Delete icon will appear
smallBooleannofalseIf set true, a small chip with display
heightStringno32pxCustom height of chip

Listeners

The chip component fires the following events:

delete: When delete icon is clicked, it fires the event.

<!-- template -->
<shapla-chip @delete="handleDeleteEvent"></shapla-chip>


<!-- method -->
methods: {
    handleDeleteEvent(){
    // Handle delete event
    }
}