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

 

相关文章:

  • 2021-09-15
  • 2021-10-21
  • 2022-02-26
  • 2021-11-13
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
  • 2021-05-19
  • 2021-04-11
  • 2021-10-25
  • 2021-09-29
相关资源
相似解决方案