1.0.2 • Published 4 years ago

shapla-chip v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
4 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 i shapla-chip

Usage

Add the component:

import shaplaChip from 'shapla-chip';

export default {
  name: 'Hello',

  components: {
    shaplaChip
  },
  
  methods: {
    handleDeleteEvent(){
      // Handle click event
    }
  }
}
<shapla-chip text="Sayful Islam" :deletable="true" @delete="handleDeleteEvent"></shapla-chip>

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