1. 不光要引入css ,还要引入js

react 中使用阿里彩色图标

2. 在需要引入icon的地方添加

<svg className={styles.menuIcon} aria-hidden="true">
    <use xlinkHref="#icon-woshiicon"/>  // #icon-woshiicon 为 Font-class

</svg>

3. css

.menu-icon {
  width: 1em; 
  height: 1em;
  fill: currentColor;
  overflow: hidden;
  // 以上是svg图标通用样式

  font-size: 30px;
}

 

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2022-01-15
  • 2021-11-18
  • 2021-12-21
  • 2021-10-05
  • 2021-05-01
  • 2021-11-10
猜你喜欢
  • 2021-09-11
  • 2022-02-06
  • 2021-10-01
  • 2021-09-13
  • 2021-12-06
  • 2021-12-22
  • 2021-12-26
相关资源
相似解决方案