1.1.5 • Published 3 years ago

vue-js-star-rating v1.1.5

Weekly downloads
48
License
ISC
Repository
github
Last release
3 years ago

Vue.js fontawesome icon rate component

It's easy to use Vue.js component for star rating!

  1. This package is fully customized (Shape, Color, Rate, ...).
  2. I used Vue font awesome.
  3. You can change your rating shape with free and open source font awesome project.

vue-js-star-rating

Install package

  1. Install with npm npm i vue-js-star-rating --save
  2. Install with yarn yarn add vue-js-star-rating --save

Code sample

After import and registering component in your Vue.js application:

<template>
  <div>
    <vue-star-rate
      :rateRange="3"
      :maxIcon="5"
      :iconHeight="22"
      :iconWidth="22"
      :hasCounter="true"
      iconColor="#FFFF99"
      iconColorHover="#FFFF99"
      iconShape="star"
    ></vue-star-rate>
  </div>
</template>

<script>
import vueStarRate from "vue-js-star-rating";
export default {
  components: { vueStarRate }
};
</script>

Documents

AttributeDescriptionTypeDefault
rateRangeNumber of active iconNumber3
maxIconNumber of iconsNumber5
iconHeightIcon heightNumber45
iconWidthIcon widthNumber45
hasCounterCounter like 3 of 5Booleantrue
iconColorColor of iconString#f3d23e
iconColorHoverColor of hover iconString#f3d23e
iconShapeShape of icon like star, heart, etcStringstar
ratingSetEvent after click on iconEventnull

Events

When a star is clicked, an event is emitted called ratingSet. You can listen for this event to get the value of the rating.

<template>
  <div>
    <vue-star-rate v-on:ratingSet="myRatingMethod"></vue-star-rate>
  </div>
</template>

<script>
import vueStarRate from "vue-js-star-rating";
export default {
  components: { vueStarRate },
  methods: {
    myRatingMethod(rating) {
      console.log("The selected rating is " + rating);
    }
  }
};
</script>
1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago