1.0.1 • Published 4 years ago

ra-star-rating v1.0.1

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

ra-star-rating

🌟 A simple star rating component for vue.js. Perhaps, each can have its own rating star component.

Demo

Install.

# yarn 
yarn add ra-star-rating

# npm
npm install --save ra-star-rating

Usage.

import raStarRating from 'ra-star-rating'

<ra-star-rating config></ra-star-rating>

期望配置 https://github.com/PRNDcompany/ReactSvgStarRating

props

PropsDescriptionDefault
mode分数增量。目前只支持1,0.5,0.01。1表示每次点击为一颗星,0.5表示半颗星,0.01即随着鼠标移动1
rating初始评分0
order星星评分顺序。支持从左往右|从右往左'ltr', 'rtl''ltr'
star-points星星数量。也表示最大评分5
readOnly只读模式。false
strokestroke stroke-width stroke-linecap stroke-dasharray 属性{}
emptyColor星星非突出显示部分的颜色null
fillColor星星突出显示部分的颜色false
size星星的大小50
zoom星星的缩放比例,建议为radio的两倍4
ratio内圆和外圆的比例,决定星星的风格,建议为2 & 2.52
padding星星的padding,使得更加容易确定min分或者max5

TODO

  • 星星绘图
  • 支持颜色填充
  • 支持渐变颜色
  • 支持自定义配置星星数量
  • 支持星星大小配置
  • 支持评分方向(左侧|右侧)
  • 支持半星评分
  • 支持小数(百分比)评分
  • 支持星星自定义样式修改
  • 支持星星旋转
  • 支持只读模式
  • 支持反馈评分数
  • 支持AMD引入

Process

Process

MIT

MIT