renderings
official icon
icon font icon
Install
install dependencies
cnpm install @element-plus/icons-vue
Write src/plugins/icons.js
import * as components from "@element-plus/icons-vue";
export default {
install: (app) => {
for (const key in components) {
const componentConfig = components[key];
app.component(componentConfig.name, componentConfig);
}
},
};
introduce
Modify main.js
import elementIcon from "./plugins/icons";
app.use(elementIcon)
Common attributes of el-icon
size: the size of the icon [the font size is inherited by default]
color: icon color [default inherited color]
use
<el-icon size="80px" color="red"><ChromeFilled /></el-icon>