如何在nuxt中使用element-ui
一、在nuxt中安装element-ui
1.在nuxt中运行下面代码
npm install element-ui --save
2.在package.json中查看
3.在plugins中添加 ElementUI.js
import Vue from "vue";
import ElementUI from "element-ui";
Vue.use(ElementUI);
4.在nuxt.config.js中添加
css: [
"element-ui/lib/theme-chalk/index.css"
],
plugins: [
{ src: "~plugins/ElementUI" },
],
5.以上步骤完成后就可以测试了
在pages下的index.vue中添加
<el-row>
<el-button plain>朴素按钮</el-button>
<el-button type="primary" plain>主要按钮</el-button>
<el-button type="success" plain>成功按钮</el-button>
<el-button type="info" plain>信息按钮</el-button>
<el-button type="warning" plain>警告按钮</el-button>
<el-button type="danger" plain>危险按钮</el-button>
</el-row>
总结
:
:以上就是今天要讲的内容,本文仅仅简单介绍了如何在nuxt中使用element-ui希望能对你有所帮助