分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

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

发布时间:2023-09-06 02:12责任编辑:赖小花关键词:暂无标签
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

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved