ElementUI是一个组件库,是VueUI的一种
搭建环境(基于脚手架)
1.安装node.js,配置淘宝镜像地址
npm config set registry https://registry.npm.taobao.org/
npm config list
2.全局安装VueCli(脚手架)
npm install -g @vue/cli
3.进入项目目录,创建项目包
vue create (element-pro)项目包名,然后配置
4.在新建的项目包安装ElementUI组件库
npm i element-ui -S
5.在脚手架项目找到main.js配置ElementUI
import Vue from 'vue';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue';
Vue.use(ElementUI);
6.在项目包下运行
npm run serve
7.访问网址
http://localhost:8080/实际就是项目包public文件夹的index.js
ElementUI常用组件
Element - The world's most popular Vue UI framework