zoukankan      html  css  js  c++  java
  • html如何添加五角星/星星图案

    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 + "☆";
       
        }
    }
    }
    

      效果:

  • 相关阅读:
    仓储模式Repository
    jwt测试
    net core webapi jwt
    net core发布到iis遇到的困难
    新的目标
    L9-2.安装mysql数据库
    L9-1-安装Apache
    L8_2
    Linux 08
    Linux 07 故障恢复
  • 原文地址:https://www.cnblogs.com/watermarks/p/9543686.html
Copyright © 2011-2022 走看看