vue 星级组件
来源:互联网 发布:app源码出售 编辑:程序博客网 时间:2024/05/17 03:12
</div></div>
export default{ props:{ size: { type: Number }, score: { type: Number }, starAll: { type: Number } }, computed:{ showWidth(){ let res = parseInt( this.score / this.starAll * 100) ; return 'width:'+res+'%'; } }}
.star-box{
position: relative;
overflow: hidden;
display: inline-block;
vertical-align: middle;
span{
display:inline-block;
}
.star-y{
position: absolute;
top: 0;
left: 0;
overflow:hidden;
}
.star-g{
}
}
.col-g{
color: gray;
}
.col-y{
color: orange;
}
阅读全文