1.下载依赖包
npm install @element-plus/icons-vue
或者
yarn add @element-plus/icons-vue
2.引入核心文件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
app.use(ElementPlus,)
3.上边是引入基本样式,想要用到icon图标还需用到
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
4.直接引入所需要的标签就好了
<el-icon>
<ArrowDownBold size="25px" v-if="!show" />
<ArrowUpBold size="25px" v-if="show" />
</el-icon>
原文链接:https://element-plus.gitee.io/zh-CN/component/icon.html
本文档介绍了如何在项目中引入并使用Element Plus Icons-Vue。首先,你需要通过npm或yarn安装依赖。接着,导入Element Plus库和其样式文件,并注册所有图标组件。最后,可以直接在页面中使用所需的图标标签,如`<ArrowDownBold>`和`<ArrowUpBold>`。这是一个关于前端开发中Vue组件和图标库使用的教程。
4万+

被折叠的 条评论
为什么被折叠?



