【笔记】ElementPlus学习笔记

前言

基于 Vue 3,面向设计师和开发者的组件库(官网

下载依赖

Vue3

1
npm install element-plus

引入并注册组件

全量引入

src/main.js
1
2
3
4
5
6
7
8
import { createApp } from "vue"
import App from "./App.vue"
import ElementPlus from "element-plus"
import "element-plus/dist/index.css"

const app = createApp(App);
app.use(ElementPlus);
app.mount("#app");

按需引入

使用组件

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

完成