vue3中引入element-plus的 @element-plus/icons-vue.(已成功)

CSDN博客 · · 318 次点击 · · 开始浏览    

vue3中引入element-plus的 @element-plus/icons-vue

最近使用element-plus开发项目,@element-plus/icons-vue 全局安装
依据官网(官网地址)的使用方法不知道什么原因 icon 的 样式一直不显示,搞了半天,不知道什么原因又好了,贴一下代码。

安装
NPM
$ npm install @element-plus/icons-vue
  • 1
  • 2
全局引用

main.ts里面导入引入 icon

import * as Elicons from "@element-plus/icons-vue";
const app = createApp(App);
for (const name in Elicons) {
  app.component(name, Elicons[name]);
}
  • 1
  • 2
  • 3
  • 4
  • 5

本文来自:CSDN博客

感谢作者:CSDN博客

查看原文:vue3中引入element-plus的 @element-plus/icons-vue.(已成功)

318 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传