【笔记】ElementUI学习笔记

前言

Element,一套为开发者、设计师和产品经理准备的基于 Vue 2.0 的桌面端组件库(官网

下载依赖

Vue2

1
npm install element-ui

引入并注册组件

全量引入

1
2
3
4
5
6
7
8
9
10
11
12
import Vue from "vue"
import App from "./App.vue"
import ElementUI from "element-ui"
import "element-ui/lib/theme-chalk/index.css"

Vue.config.productionTip = false
Vue.use(ElementUI);

const app = new Vue({
render: h => h(App),
});
app.$mount('#app');

按需引入

使用组件

1
2
3
<template>
<el-button type="primary"></el-button>
</template>

完成