持续创作,加速成长!这是我参与「掘金日新计划 · 10 月更文挑战」的第3天,点击查看活动详情
一、安装element-plus插件
二、全局引入
- 从路径
element-plus/lib/index中所有组件的组件 - 引入样式表
element-plus/theme-chalk/index.css - 通过 **
app**.use()方法使用插件
三、手动按需引入
在main.js中的配置
- 从路径
element-plus/lib/index中引入需要的组件 - 引入样式表
element-plus/theme-chalk/index.css - 通过 **
app**.use()方法使用插件
四、自动按需引入
(一)安装插件
(二)在vue.config.js配置文件中信息配置信息(使用webpack打包)
五、使用Menu-Collapse 折叠面板组件
(一)CommonAside.vue
- 将html布局代码复制到
template块中,并按需求修改响应代码 - 将样式相关代码复制到
style块中
(二)在main.js中的配置
- 在main.js中按需引入
element-plus中的组件 - 使用
app.component()方法使用组件
(三)使用图标
1、安装图标组件
2、注册所有图标
- 从路径
@element-plus/icons-vue中导入所有图标 - 通过 **
app**.component()方法注册所有图标
3、按需引入
- 从路径
@element-plus/icons-vue中引入需要的图标 - 通过 **
app**.component()方法注册需要的图标