1.安装
npm install element-ui -S //安装到本地开发者环境中
安装成功后:package.json文件中会有以下信息
2.导入
import ElementUI from 'element-ui'; //导入组件
import 'element-ui/lib/theme-chalk/index.css'; //导入样式
Vue.use(ElementUI); //全局引用
3.参照官方文档开发
home.vue中:
<template>
<el-row>
<el-button>默认按钮</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="success">成功按钮</el-button>
<el-button type="info">信息按钮</el-button>
<el-button type="warning">警告按钮</el-button>
<el-button type="danger">危险按钮</el-button>
</el-row>
</template>
效果: