首先使用npm下载
npm install @element-plus/icons-vue
然后后在main.js文件导入
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
最最最最重要的一部来了,我就捣鼓了半个小时
import引入你要导入图标 比如我要导入这两个图标
import引入
import {UserFilled,Lock} from '@element-plus/icons-vue'
export default {
components: {
UserFilled,
Lock
}
}
最后一定要记得components写出来!我当时就漏了把Lock标签导入,捣鼓半个小时才发现,害