1.0.7 • Published 4 years ago

star-rate-component v1.0.7

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

Star Rate Component

NPM version GitHub version Software License

A simple component for VueJS. Star Rate Component is a component for VueJS for evaluating items through stars with or without punctuation. A customizable component in a simple and intuitive way with a sophisticated and good design.

Installation

Download (Zip)

Download this link.

Build

Clone this repository

$ git clone https://github.com/thalysonalexr/star-rate-component.git

NPM

Install the latest version by npm

$ npm install --save star-rate-component@latest

Get Started

Basic usage

Note: In your App.vue import

<template>
  <v-star-rate ref="component" />
</template>

<script>
import StarRate from 'star-rate-component'

export default {
  name: 'App',
  components: {
    // name of component star rate
    'v-star-rate': StarRate
  }
}
</script>

Get value of rating

Get a value of component by $refs in data: "note"

<script>
(...)
export default {
  (...)
  methods: {
    show () { console.log(this.$refs.component.note) }
  }
}
</script>
...

Set the size of the component

In property size

<template>
  <div>
    <v-star-rate ref="component1" size="sm" />
    <v-star-rate ref="component2" size="md" />
    <v-star-rate ref="component3" size="lg" />
  </div>
</template>

Properties

PropertyTypePossible valuesDescriptionRemarks
color-boxStringcolors in rgb, rgba or hexadecimalColor for container box in componentNo required, default: #fcfcfc
color-textStringcolors in rgb, rgba or hexadecimalColor of pontuation and titleNo required
default-color-starStringcolors in rgb, rgba or hexadecimalColor of star deselectedNo required, default: #dbdbdb
bordersBooleantrue or falseBorder in container of component (box)No required, default: true
bashineBooleantrue or falseFlashing stars animationNo required, default: false
displayStringsimple or normalSimple container without punctuation and without title. Normal container with punctuation. Container full with punctuation and titleNo required, default: full
title-boxStringAnywhere valueTitle in container box componentNo required
resultArrayValues type numberAn array with number-type values ​​of each star-rate-component component for generating an average in this result containerNo required
sizeStringsm, md or lgComponent container sizeNo required, default: md
labelsObjectAnywhere value in keys objectTitle labels of each star in the assessmentNo required, default: {terrible: 'terrible', bad: 'bad', good: 'good', great: 'great', perfect: 'perfect'}

Credits

License

MIT License © 2018 - 2020 Made with ♥ by Thalyson Rodrigues

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.0

6 years ago