一:选择一个你喜欢的包管理器
NPM
$ npm install @element-plus/icons-vue
Yarn
$ yarn add @element-plus/icons-vue
pnpm
$ pnpm install @element-plus/icons-vue
二:在mainjs中引入
import * as ElementPlusIconsVue from ‘@element-plus/icons-vue’
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
三:选择需要的icon,在相应页面进行引入
!
//设置图标样
.loginIcon {
height: 80px;
width: 75px;
background-color: #284062;
font-size: 55px;
padding-top: 10px;
box-sizing: border-box;
color: #cff3f7;
}