How to use element-plus in Vue3

vue3 out for some time, element has also been updated to version compatible vue3, where a brief look at how to use the element-plus it

1. Installation

npm install element-plus --save

2. Introduce

import {
    
     createApp, Vue } from 'vue';
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
import App from './App.vue';

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

3. Use
Here is the button

<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>

You can check the official documents for details

Guess you like

Origin blog.csdn.net/GongWei_/article/details/109986596