1.0.6 • Published 4 years ago

vue-clap-button v1.0.6

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

A Medium like clap button. Inspired by react-clap-button

Install

The recommended way is using npm

npm install vue-clap-button --save

Also you can insert script tag in your html file after vue script

<script src="dist/vue-clap-button.js"></script>

Usage

In your entry script

import Vue from 'vue'
import vueClapButton from 'vue-clap-button'
Vue.use(vueClapButton);

Then in your .vue file

<vue-clap-button />

It is done! Really simple to use ? Yes ❤

Want a complex example ? see following guide

Attributes

parameterdescriptiontypeenum valuedefault value
iconspecify a iconStringgood, star, lovegood
sizechange the size of icon, in pixelNumber-50
maxClickHow many times can I love/like it?Number-1
bgColorbackground color of iconString-#FFF
colorActivecolor for icon with clapsString-#F56C6C
colorNormalnormal or initial color for icon without clapsString-#909399
initClickedfor button which initial state is clickedNumber-0

Events

event namedescriptioncallback parameter
canceluser cancel all claps on it-
clapuser give one love on ittotal claps given now (type : number)

Methods

method namedescriptionreturn value
getClapsget total clapstype:Number

License

MIT

1.0.6

4 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago