修改svg-icon的颜色

<svg width="18px" height="20px" viewBox="0 0 18 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <path d="M0.00208546069,19.0686208 C-0.0265515297,19.3485908 0.244783954,19.5539744 0.505640902,19.4402508 C0.816959699,19.3044638 3.74016727,18.0263645 5.10131379,17.4306717 L0.555365131,14.0759785 C0.384627923,15.5900292 0.0273597741,18.8213881 0.00208546069,19.0686208 Z M0.997372738,12.7892447 L6.21624728,16.6405945 L14.6176677,5.22257087 L9.39872809,1.37128618 L0.997372738,12.7892447 Z M6.85869213,14.7572785 L6.2966478,14.3425411 L6.71079943,13.7796724 L7.27284375,14.1944315 L6.85869213,14.7572785 Z M13.3076339,5.99279744 L7.50951112,13.8728077 L6.9474451,13.4580052 L12.7456112,5.57803836 L13.3076339,5.99279744 Z M15.1164286,2.86110391 L11.5033299,0.194804852 C11.0598471,-0.132437847 10.4354956,-0.0377405268 10.1087736,0.406371465 L9.81296649,0.808417454 L15.0318844,4.65970215 L15.3277132,4.25765616 C15.6544352,3.81360925 15.5598464,3.18832491 15.1164069,2.86108221 L15.1164286,2.86110391 Z M6.21498899,19.4552419 L18,19.4552419 L18,18.6074134 L6.21498899,18.6074134 L6.21498899,19.4552419 Z M9.33229895,14.537815 L9.33229895,15.3856435 L18,15.3856435 L18,14.537815 L9.33229895,14.537815 Z" id="Shape" fill="currentColor" fill-rule="nonzero"></path>
    </g>
</svg>

首先要把svg中fill="currentColor",不改没有效果

<svg-icon icon-class="icon8" class="svgColor" />
.svgColor{
  color:#606266
}

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值