项目作者: thalysonalexr

项目描述 :
🖖 A very simple component of Star Rating for Vue.Js :star::star::star::star::star:
高级语言: Vue
项目地址: git://github.com/thalysonalexr/star-rate-component.git
创建时间: 2018-08-03T21:36:22Z
项目社区:https://github.com/thalysonalexr/star-rate-component

开源协议:MIT License

下载


Star Rate Component

NPM version
GitHub version
Software License



Star Rate Component

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

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

NPM

Install the latest version by npm

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

Get Started

Basic usage

Note: In your App.vue import

  1. <template>
  2. <v-star-rate ref="component" ></v-star-rate>
  3. </template>
  4. <script>
  5. import StarRate from 'star-rate-component'
  6. export default {
  7. name: 'App',
  8. components: {
  9. // name of component star rate
  10. 'v-star-rate': StarRate
  11. }
  12. }
  13. </script>

Basic usage

Get value of rating

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

  1. <script>
  2. (...)
  3. export default {
  4. (...)
  5. methods: {
  6. show () { console.log(this.$refs.component.note) }
  7. }
  8. }
  9. </script>
  10. ...

Set the size of the component

In property size

  1. <template>
  2. <div>
  3. <v-star-rate ref="component1" size="sm" ></v-star-rate>
  4. <v-star-rate ref="component2" size="md" ></v-star-rate>
  5. <v-star-rate ref="component3" size="lg" ></v-star-rate>
  6. </div>
  7. </template>

Size of component

Properties

Property Type Possible values Description Remarks
color-box String colors in rgb, rgba or hexadecimal Color for container box in component No required, default: #fcfcfc
color-text String colors in rgb, rgba or hexadecimal Color of pontuation and title No required
default-color-star String colors in rgb, rgba or hexadecimal Color of star deselected No required, default: #dbdbdb
borders Boolean true or false Border in container of component (box) No required, default: true
shine Boolean true or false Flashing stars animation No required, default: false
display String simple or normal Simple container without punctuation and without title. Normal container with punctuation. Container full with punctuation and title No required, default: full
title-box String Anywhere value Title in container box component No required
result Array Values type number An array with number-type values ​​of each star-rate-component component for generating an average in this result container No required
size String sm, md or lg Component container size No required, default: md
labels Object Anywhere value in keys object Title labels of each star in the assessment No required, default: {terrible: 'terrible', bad: 'bad', good: 'good', great: 'great', perfect: 'perfect'}

Credits

License

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