element-ui提供的字体图标是很少的,所以我们需要集成其它图标来使用,nodejs的集成官方有说明,这里说明一下非nodejs开发集成图标

首先下载fontawesome,需要更改里面图标前缀,附件中已经更改了,可以直接用

附件下载:fontawesome.zip

引用代码如下:

<link href="/your-path/font-awesome.min.css" rel="stylesheet" type='text/css' />
<style type="text/css">
    [class^="el-icon-fa"], [class*=" el-icon-fa"] {
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome!important;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
</style>

使用如下:

<i class="fa el-icon-fa-firefox"></i>
<i class="el-icon-fa-hand-o-right"></i>
<el-input icon="fa-tree"></el-input>

 

相关文章:

  • 2021-12-03
  • 2021-12-03
  • 2021-07-01
  • 2021-08-21
  • 2021-12-03
  • 2021-08-02
  • 2021-12-03
猜你喜欢
  • 2021-10-09
  • 2021-09-24
  • 2021-12-03
  • 2021-04-29
  • 2022-12-23
  • 2021-12-03
  • 2022-01-09
相关资源
相似解决方案