Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
awesome-vue-star-rating
Advanced tools
A simple, highly customisable star rating component for Vue 2.x without any external libraries
Simple and Easy Customisable Awesome Vue Star Rating using Pure Vue application without any external package.
npm install --save awesome-vue-star-rating
Property | Type | Required | Description |
---|---|---|---|
star | Number | Required. | Default value of Star. Default value is 2 |
maxstars | Number | Required. | Default value is 5 . |
hasresults | Boolean | Optional. | Displaying the result values. Default value is true . |
hasdescription | Boolean | Optional. | Default value is true . |
ratingdescription | Array | Required. | Displaying the rating values. Ex. [{
text: 'Poor',
class: 'star-poor'
},
{
text: 'Below Average',
class: 'star-belowAverage'
},
{
text: 'Average',
class: 'star-average'
},
{
text: 'Good',
class: 'star-good'
},
{
text: 'Excellent',
class: 'star-excellent'
}] |
starsize | String | Optional. | Displaying the size of the stars. Default value is lg . We have list of [xs,lg,1x,2x,3x,4x,5x,6x,7x,8x,9x,10x] other optional values too. |
disabled | Boolean | Optional. | Enable or disable the star selection. Default value is false . |
Step 1: import AwesomeVueStarRating in our component
import AwesomeVueStarRating from 'awesome-vue-star-rating'
export default {
name: 'app',
components: {
AwesomeVueStarRating
}
}
</script>
Step 2: Load default values to the component
data() {
return {
star: 5, // default star
ratingdescription: [
{
text: 'Poor',
class: 'star-poor'
},
{
text: 'Below Average',
class: 'star-belowAverage'
},
{
text: 'Average',
class: 'star-average'
},
{
text: 'Good',
class: 'star-good'
},
{
text: 'Excellent',
class: 'star-excellent'
}
],
hasresults: true,
hasdescription: true,
starsize: 'lg', //[xs,lg,1x,2x,3x,4x,5x,6x,7x,8x,9x,10x],
maxstars: 5,
disabled: false
}
}
Step 3: Place the Rate component inside the template
<template>
<div id="app">
<AwesomeVueStarRating :star="this.star" :disabled="this.disabled" :maxstars="this.maxstars" :starsize="this.starsize" :hasresults="this.hasresults" :hasdescription="this.hasdescription" :ratingdescription="this.ratingdescription" />
</div>
</template>
Step 4: Customize the star color styles like below
<style lang="scss">
.star {
color: red;
}
.star.active {
color: red;
}
.list, .list.disabled {
&:hover {
.star {
color: red !important;
}
.star.active {
color: red;
}
}
}
</style>
npm run serve
npm run build
npm run test
FAQs
A simple, highly customisable star rating component for Vue 2.x without any external libraries
The npm package awesome-vue-star-rating receives a total of 20 weekly downloads. As such, awesome-vue-star-rating popularity was classified as not popular.
We found that awesome-vue-star-rating demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.