使用 element 引用阿里图标库的方法如下:

  1. 在 main.js 中引入阿里图标库的样式文件:
import 'font-awesome/css/font-awesome.css'
import 'element-ui/lib/theme-chalk/icon.css'
  1. 在组件中使用 element 的 组件,并设置 class 属性为阿里图标库中的图标名称:
<template>
  <div>
    <el-icon class="fa fa-search"></el-icon>
  </div>
</template>

这样就可以使用阿里图标库中的图标了。其中,class 属性中的 "fa fa-search" 就是阿里图标库中搜索图标的名称。可以在阿里图标库网站上查找其他图标的名称。

element怎么使用自己的icon来引用阿里图标库

原文地址: https://www.cveoy.top/t/topic/MXm 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录