首页 > Web开发 > 详细

html如何添加五角星/星星图案 - GitHub - octicons

时间:2018-08-27 20:54:25      阅读:218      评论:0      收藏:0      [点我收藏+]
bootstrap-4 移除了glyphicons/glyphicons-migration
有没有其他方法添加五角星/星星图案。
使用github octicons:
npm install octicons

<svg width="20" height="20" viewBox="0 0 16 16" aria-hidden="true">
<image xlink:href="node_modules/octicons/build/svg/star.svg" />
</svg>

ref:https://github.com/primer/octicons/issues/123
https://stackoverflow.com/questions/32612690/bootstrap-4-glyphicons-migration
http://efe.baidu.com/blog/delivering-octicons-with-svg/

商品星星评分:
export class StarsComponent implements OnInit {
@Input()
  private  rating: number =0;

  private staricon: string;

  constructor() {
  }

  ngOnInit() {
    this.staricon = "";
    for(let i=1;i<=5;i++){
      if(i<= this.rating) this.staricon = this.staricon + "★";
      else this.staricon = this.staricon + "☆";
   
    }
}
}

  效果:

技术分享图片

 

html如何添加五角星/星星图案 - GitHub - octicons

原文:https://www.cnblogs.com/watermarks/p/9543686.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!